forked from cerc-io/snowballtools-base
f2e59c11fd
### TL;DR Implemented the new `VerifyCodeInput` component and updated the access code validation logic. ### What changed? 1. Added a new reusable `VerifyCodeInput` component for verifying codes in a user-friendly way. This component handles paste events, input changes, and keyboard navigation. 2. Updated the backend route `/accesscode` to accept an arbitrary code for now. 3. Incorporated the `VerifyCodeInput` component into the `AccessCode` page, replacing the generic `Input` component. 4. Updated the access code validation logic to check for a trimmed length of 5 characters instead of 6. 5. Added a slight pause for UX purposes when validating the access code on the frontend. ### How to test? 1. Go to the Access Code page. 2. Try entering an access code with various inputs (keyboard, paste, etc.) to see if it works seamlessly. 3. Verify that only a 5-digit code is considered valid. 4. Check the backend logs to ensure the validation endpoint is working as expected. ### Why make this change? This change improves the user experience by providing a custom input component for access code verification and ensures that the access code validation meets the new requirements. --- |
||
---|---|---|
.. | ||
.storybook | ||
public | ||
src | ||
.env.example | ||
.eslintrc.cjs | ||
.gitignore | ||
.node-version | ||
.prettierignore | ||
.prettierrc.json | ||
chromatic.config.json | ||
index.html | ||
package.json | ||
postcss.config.js | ||
README.md | ||
reload-dev.sh | ||
tailwind.config.js | ||
tsconfig.json | ||
tsconfig.node.json | ||
vite.config.ts |
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptions
property like this:
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
};
- Replace
plugin:@typescript-eslint/recommended
toplugin:@typescript-eslint/recommended-type-checked
orplugin:@typescript-eslint/strict-type-checked
- Optionally add
plugin:@typescript-eslint/stylistic-type-checked
- Install eslint-plugin-react and add
plugin:react/recommended
&plugin:react/jsx-runtime
to theextends
list