Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@open-tender/components
Advanced tools
A component library built for use with the Open Tender open source web app
A component library for use with the Open Tender open source web app: open-tender-web.
This library is only relevant for restaurant brands that are customers of Open Tender. To learn more about establishing an Open Tender account, please visit our website.
Install via yarn:
yarn add @open-tender/components
Or via npm:
npm install --save @open-tender/components
This library handles some of the most complex components featured in the Open Tender web app, including:
<CheckoutForm />
The benefits of using this libray are many:
<CheckoutForm />
is super complex based on the flexibility of the Open Tender platform around different tender types, service charges, discounts, promo codes, gift cards, loyalty points, etc.<Builder />
used to associate modifiers with a menu item handles a fairly complex set of rules across one or more modifier groupsThese are all very important components, and if you leverage this library, you can drop them in and they all just work.
In addition, many of the components have been decoupled into custom hooks and presentational components so you can customize the presentation while getting all the complex functionality "for free" (the useBuilder
custom hook is a prime example, and all of the forms are implemented this way).
In general, this library is designed to handle the hard stuff for you, so you can focus on the fun parts of designing and building a customized user experience.
This library leverages Emotion for CSS-in-JS styled components and theme support via the @emotion/react
and @emotion/styled
packages (which are installed in the open-tender-web app).
The theme is passed down by the open-tender-web app, and you can read more about how this works via the Styling with Emotion section of the open-tender-web readme.
The punchline here is that all of these components come with a brand's styles built-in, which is helpful for things like buttons that come in four different variations.
As noted above, one of the most common uses of this library in the open-tender-web app is for button variations. A brand can configure four different types of buttons that come in one of four possible color combinations. Here's an example:
import { ButtonStyled } from '@open-tender/components'
<ButtonStyled
icon={<Home size={null} />}
onClick={() => history.push('/')}
size="big"
color="secondary"
>
Home
</ButtonStyled>
In this case, we're using the "big" button type and the "secondary" color scheme. You can see all of the possibilities in the buttons
attribute of the example Open Tender theme.
Here's an example of using a form component:
import { ProfileForm } from '@open-tender/components'
const AccountProfile = () => {
const dispatch = useDispatch()
const { profile, loading, error } = useSelector(selectCustomer)
const update = useCallback(
(data) => dispatch(updateCustomer(data)),
[dispatch]
)
return (
<ProfileForm
profile={profile}
loading={loading}
error={error}
update={update}
/>
)
}
As you can see above, the form receives data and a dispatch function from the open-tender-web app, and all of the inputs, error handling, etc. is handled by the <ProfileForm />
component. So you don't need to worry about creating all of the different inputs and handling user input - the inputs will automatically come with the brand's configured styles. Here's an example of what this form looks like:
Pretty complex, but all of the inputs are styled for you via the theme, which is configured by the brand in the Open Tender Admin Portal:
If you want to customize the inputs beyond what comes with the theme styles, then you can use the useProfileForm
custom hook and build the inputs and form yourself, following the example of the <ProfileForm />
component in this library.
You can see many more examples in the open-tender-web app itself.
If you find a bug or have a question, please file an issue on our issue tracker on GitHub.
Built and maintained by Open Tender.
FAQs
A component library built for use with the Open Tender open source web app
The npm package @open-tender/components receives a total of 6 weekly downloads. As such, @open-tender/components popularity was classified as not popular.
We found that @open-tender/components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.