Global

Members

(constant) Card

Source:

!DEPRECATED: Do not use. This component is too opinonated

(constant) CardBody

Source:

!DEPRECATED: Do not use. This component is too opinonated

(constant) clients

Source:
Deprecated:
  • since version 2.42.0 - using static clients.json instead to fetch from backend

(constant) Drawer

Source:

Depending on the step, returns an appropriate widget

state

Source:

This is where you can pass more information to prefill the next page e.g. email, phone, first and last name

(constant) TOOLTIP_DIRECTIONS :string

Source:
Properties:
Name Type Description
BOTTOM string
LEFT string
RIGHT string
TOP string

Enum for class direction values.

Type:
  • string

view

Source:

Chip title6_baseBrown_roundedAccentLight has view field that is not null

Methods

(async) axiosRequest(path, method, data, headers) → {Promise.<*>}

Source:

helper method to perform an api requests

Parameters:
Name Type Description
path.method
path
method
data
headers
path.path
path.data
path.config
Returns:
Type
Promise.<*>

CardTitle(root0)

Source:

!DEPRECATED: Do not use. This component is too opinonated

Parameters:
Name Type Description
root0
Properties
Name Type Description
className
children

componentDidUpdate(component, init)

Source:
Parameters:
Name Type Description
component
init

Controller1Provider(props)

Source:

Controller logic for login type 1. Tries to encapsulate as much as it should

Parameters:
Name Type Description
props object
Properties
Name Type Description
children object

Render Function or React element

onLoginComplete function

Function to run when login completes

onSignupComplete function

Function to run when signup completes

onComplete function

Function to run when entire process completes

onNextStep function

callback to run when the step changes

createUniqueResGroupMap(menuGroupHash) → {object}

Source:

Receive a array of menus and generate a Map with structure of [restaurantGroupId] : [menu, menu]

Parameters:
Name Type Description
menuGroupHash array

Either upsell, item, empty default to item

Returns:
Type
object

directionClass(dir)

Source:

Select the css class to suffix the main class which will apply direction specific styling

Parameters:
Name Type Description
dir string

Direction to render tooltip. Valid values are top, bottom, right, left. Default is top

disableScroll()

Source:

enableScroll()

Source:

eventHandler()

Source:

Lunchbox Tools Event Handler Execute an event after initialization or add to a window queue

FacebookButton(root0)

Source:
Properties:
Name Type Description
props object
Properties
Name Type Description
lastLocation function

set the browser location this component was rendered under

socialLogin function

takes the response from facebook and uses the token

Setting it to redirect to be consistent with Facebook sign in

Parameters:
Name Type Description
root0
Properties
Name Type Description
socialLogin
lastLocation
appId

getMarketMenuMap(menuGroupHash) → {object}

Source:

Trim groupHash Value and return the first two of each menu group

Parameters:
Name Type Description
menuGroupHash object

Either upsell, item, empty default to item

Returns:
Type
object

getScrollPosition(root0)

Source:
Parameters:
Name Type Description
root0
Properties
Name Type Description
element
useWindow

getSize()

Source:

GoogleButton(root0)

Source:
Properties:
Name Type Description
props object
Properties
Name Type Description
clientId function

Client Id provided found in the google project

socialLogin function

takes the response from Google and uses the token

Setting it to redirect to be consistent with Google sign in

Parameters:
Name Type Description
root0
Properties
Name Type Description
socialLogin
clientId

GroupType1(props)

Source:

Renders UI for items inside of a subgroup for type1 (radio button)

Parameters:
Name Type Description
props object
Properties
Name Type Description
items number

From BeamImpact

selected string

Checkout Step

error object

State in pages/Cart/routes.jsx

types object

Theme file cell types

Properties
Name Type Description
group object

Theme for container that holds subgroup items

default object

State in pages/Cart/routes.jsx

selected object

State in pages/Cart/routes.jsx

onSelect function

When a subgroup item is selected

Image(props)

Source:

Returms image tag with the attributes set

Parameters:
Name Type Description
props object
Properties
Name Type Description
src string

URL of the image

defaultSrc string

Fallback src used for placeholders if src is not provided

alt string

alt text of image

Image1(props)

Source:

! DEPRECATED: do not use. Use from elements folder Returns an image tag with the url of the file from the s3 assets bucket

Parameters:
Name Type Description
props object
Properties
Name Type Description
mediaName string

Name of the file ex art_menu_header.jpg

mediaType string

File extension if needed to override the extension on the mediaName ex png, svg

ImageUrlGenerator(mediaName, mediaType)

Source:

Helper function for returning an asset URL

Parameters:
Name Type Description
mediaName string

Name of the file ex art_menu_header.jpg

mediaType string

File extension if needed to override the extension on the mediaName ex png, svg

InlineLoader(root0)

Source:

All other props are spread onto the root <svg> element

Parameters:
Name Type Description
root0
Properties
Name Type Description
size
color

InterceptCheckoutComplete(props)

Source:

Interceptor between checkout and purchase-complete confirmation If the patron(user) is:

  • new to Beam, show Beam widget in the interceptor before going to purchase-complete confirmation
  • not new, bring the user straight to purchase-complete confirmation
Parameters:
Name Type Description
props object
Properties
Name Type Description
style object

From theme file & withTemplate HOC

patronEmail string

From BeamImpact

beam object

State in pages/Cart/routes.jsx

setBeam function

Setter method for state in pages/Cart/routes.jsx

onComplete function

Func to bring the user to Routes.PURCHASE_COMPLETE - from home.jsx

onSkipBeamSelection Fuction

Alternate Func to bring the user to Routes.PURCHASE_COMPLETE - from home.jsx

setHeader function

Func to set the header of the cart - from home.jsx

LoyaltyHeader(props)

Source:

Return a loyalty header with the attributes set

Parameters:
Name Type Description
props object
Properties
Name Type Description
type string

Cell type from theme file

center string

whether to center text or not

MobileAppDownload(style)

Source:

Renders mobile app download text, imgs with links

Parameters:
Name Type Description
style.style
style object

nestedModifierState(optionId, modId, modsState)

Source:
To Do:
  • Test using multiple nested tiers...
  • Move this to the mods context

nestedModifierState - recursively search modifiers state for the modifiers of an option. Read https://www.notion.so/Item-Details-9bfe384406a64e71a2f23ac59afc50a1 first.

Parameters:
Name Type Description
optionId string

the option to search

modId string

the item id to search

modsState object

the modifier state

objDifference(fromObject, toObject) → {Object}

Source:

Deep diff between two object-likes

Parameters:
Name Type Description
fromObject Object

the original object

toObject Object

the updated object

Returns:
  • a new object which represents the diff
Type
Object

onClick - parent container click action (e) → {function}

Source:
Parameters:
Name Type Description
e *

event

Returns:
  • add or remove current modifier from parent state
Type
function

onClickBack(memory)

Source:
Author:
  • Htin Linn Aung Action on Click Back
Parameters:
Name Type Description
memory object

onWheelHandler(e, scrollingRef)

Source:
Parameters:
Name Type Description
e
scrollingRef

Pincode(props)

Source:
Parameters:
Name Type Description
props object
Properties
Name Type Description
account string

account, either email or phone

accountType string

enum 'email' or 'phone'

style string

style information from theme.json file provided by withTemplate HOC

message string

An additional message to display to the user. Provided externally

onSuccess function

Callback for action to happen after validation is successful

onUpdatePhone

POST_BEAM_TRANSACTION(widgetId, data)

Source:

Helper method for postTransaction

Parameters:
Name Type Description
widgetId string
data object

(async) postTransaction(beam, selectedNonprofit)

Source:

Post method for posting Beam transaction data

Parameters:
Name Type Description
beam object
selectedNonprofit

preventDefault(e)

Source:
Parameters:
Name Type Description
e

ProgressBar(views, progressPercentage)

Source:

Parent component uses this to show a progress bar with theme & progress percentage

Parameters:
Name Type Description
views.views
views object

views by parent component that uses withTemplate HOC using theme file

progressPercentage number

% of the progress to show on the bar

views.progressPercentage

removeNestedModifier(args) → {object}

Source:

Remove a modifier recursively from the mods state Structure as followed in notion.so/Item-Details-9bfe384406a64e71a2f23ac59afc50a1

Parameters:
Name Type Description
args object

list of arguments passed as an object

Properties
Name Type Description
modifications object

the current mod state

optionId string

the option we are looking for

modId string

the modifier id to remove

Returns:

Object of all modifiers with the modifier removed

Type
object

runEvent()

Source:

Lunchbox Tools Execute Event Only calls events for client enabled tools

SignUpConfirmation(props)

Source:

Depending on the step, returns an appropriate widget

Parameters:
Name Type Description
props object
Properties
Name Type Description
style object

From theme file & withTemplate HOC

widgetId string

Provided by Beam. It is in config

patronEmail string

From BeamImpact

cartTotal number

From BeamImpact

step string

Checkout Step

beam object

State in pages/Cart/routes.jsx

setBeam function

Setter method for state in pages/Cart/routes.jsx

onSeeMoreImpact function

callback for onClick on 'See More Impact' in pages/Cart/routes.jsx

onSkipBeamSelection function

Alternate Func to bring the user to Routes.PURCHASE_COMPLETE - from home.jsx

onConfirm

SignupPage(props)

Source:

Render a standalone sign up/in page where the user can either log in and be redirected to the profile page or sign up and directed to place an order

Parameters:
Name Type Description
props object
Properties
Name Type Description
history object

React router history object

isLoggedIn boolean

Is the patron logged in. used on the first render to redirect the user if theyre logged in

style object

Theme file value provided by withTemplate HOC

Properties
Name Type Description
views
cells

toolInitializers()

Source:
To Do:
  • When webpack v5 is merged in, we can use AVAILABLE_ENVS as constants.
  • Consolidate console logs into logger fn with optional condition to make code easier to read.

Tooltip(props)

Source:
To Do:
  • Implement the arrow rendering for a tooltip based on direction

Renders a tooltip that only appears whne the child of this component is rendered

Parameters:
Name Type Description
props object
Properties
Name Type Description
children object

The element that should have the tool tip rendered when hover

direction string

Direction to render tooltip. Valid values are top, bottom, right, left. Default is top

message string

Message to be displayed in the tooltip

className string

classnames

useIntersectionObserver(callback)

Source:
Parameters:
Name Type Description
callback

withModifierItem(Component) → {*}

Source:

withModifierItem - HOC for modifier items

Parameters:
Name Type Description
Component *
Properties
Name Type Description
props props

The props from the option

Returns:
Type
*

Type Definitions

props

Source:
Properties:
Name Type Attributes Description
className string <optional>

additional classes for parent container

isOptionalSingle boolean <optional>

if this modifier item is maximum of 1 and is not required

item object

itemsHash data from menu context

multiSelect boolean <optional>

if this modifier item has a maximum greater than 1

removeModifier function

remove a modifier payload from parent state

addModifier function

add a modifier payload to parent state

parent object

parent payload (option and item with selected nested modifiers)

quantity number <optional>

current modifier quantity in parent state

type string

style cell type from theme

Type:
  • object