-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add lists and collection loaders * Fix mint button display if user mint limit is reached * Improve reply error handling * Fix Form nestend inputs * Group layout components * Require logo and banner on collection creation * Add multiple nft images input on collection creation * Add 404 page * Add error boundary * Group components * Add nft page loaders
- Loading branch information
1 parent
c90f66f
commit bbde8e8
Showing
97 changed files
with
818 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
frontend/src/components/buttons/back-button/back-button.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Button, ButtonProps } from '@gear-js/vara-ui'; | ||
import { useNavigate } from 'react-router-dom'; | ||
|
||
type Props = Omit<ButtonProps, 'text' | 'children' | 'onClick'>; | ||
|
||
function BackButton(props: Props) { | ||
const navigate = useNavigate(); | ||
|
||
return <Button {...props} text="Go Back" onClick={() => navigate(-1)} />; | ||
} | ||
|
||
export { BackButton }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { BackButton } from './back-button'; | ||
|
||
export { BackButton }; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { BackButton } from './back-button'; | ||
import { CopyButton } from './copy-button'; | ||
import { FilterButton } from './filter-button'; | ||
import { LinkButton } from './link-button'; | ||
|
||
export { BackButton, CopyButton, FilterButton, LinkButton }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { LinkButton } from './link-button'; | ||
|
||
export { LinkButton }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Checkbox as VaraCheckbox, CheckboxProps } from '@gear-js/vara-ui'; | ||
import { useFormContext } from 'react-hook-form'; | ||
|
||
import { Props } from '../types'; | ||
|
||
function Checkbox({ name, ...props }: Props<CheckboxProps>) { | ||
const { register } = useFormContext(); | ||
|
||
return <VaraCheckbox {...props} {...register(name)} />; | ||
} | ||
|
||
export { Checkbox }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Checkbox } from './checkbox'; | ||
|
||
export { Checkbox }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { zodResolver } from '@hookform/resolvers/zod'; | ||
import { ReactNode } from 'react'; | ||
import { DefaultValues, FieldValues, FormProvider, SubmitHandler, useForm } from 'react-hook-form'; | ||
import { ZodType } from 'zod'; | ||
|
||
type Props<T extends FieldValues> = { | ||
defaultValues: DefaultValues<T>; | ||
schema: ZodType; | ||
children: ReactNode; | ||
className?: string; | ||
onSubmit: SubmitHandler<T>; | ||
}; | ||
|
||
function Form<T extends FieldValues>({ defaultValues, schema, children, className, onSubmit }: Props<T>) { | ||
const resolver = schema ? zodResolver(schema) : undefined; | ||
|
||
const methods = useForm<T>({ defaultValues, resolver }); | ||
const { handleSubmit } = methods; | ||
|
||
return ( | ||
<FormProvider {...methods}> | ||
<form onSubmit={handleSubmit(onSubmit)} className={className}> | ||
{children} | ||
</form> | ||
</FormProvider> | ||
); | ||
} | ||
|
||
export { Form }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Form } from './form'; | ||
|
||
export { Form }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
import { Checkbox } from './checkbox'; | ||
import { Form } from './form'; | ||
import { Input } from './input'; | ||
import { Radio } from './radio'; | ||
import { Select } from './select'; | ||
import { Textarea } from './textarea'; | ||
import { InputProps } from './types'; | ||
|
||
export { Form }; | ||
export { Form, Input, Checkbox, Radio, Select, Textarea }; | ||
export type { InputProps }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Input } from './input'; | ||
|
||
export { Input }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Input as VaraInput } from '@gear-js/vara-ui'; | ||
import { useFormContext } from 'react-hook-form'; | ||
|
||
import { InputProps } from '../types'; | ||
|
||
function Input({ name, ...props }: InputProps) { | ||
const { register, formState } = useFormContext(); | ||
const { errors } = formState; | ||
|
||
const error = errors[name]?.message?.toString(); | ||
|
||
return <VaraInput {...props} {...register(name)} error={error} />; | ||
} | ||
|
||
export { Input }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Radio } from './radio'; | ||
|
||
export { Radio }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Radio as VaraRadio, RadioProps } from '@gear-js/vara-ui'; | ||
import { useFormContext } from 'react-hook-form'; | ||
|
||
import { Props } from '../types'; | ||
|
||
function Radio({ name, ...props }: Props<RadioProps>) { | ||
const { register } = useFormContext(); | ||
|
||
return <VaraRadio {...props} {...register(name)} />; | ||
} | ||
|
||
export { Radio }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Select } from './select'; | ||
|
||
export { Select }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Select as VaraSelect, SelectProps } from '@gear-js/vara-ui'; | ||
import { useFormContext } from 'react-hook-form'; | ||
|
||
import { Props } from '../types'; | ||
|
||
function Select({ name, ...props }: Props<SelectProps>) { | ||
const { register } = useFormContext(); | ||
|
||
return <VaraSelect {...props} {...register(name)} />; | ||
} | ||
|
||
export { Select }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Textarea } from './textarea'; | ||
|
||
export { Textarea }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Textarea as VaraTextarea, TextareaProps } from '@gear-js/vara-ui'; | ||
import { useFormContext } from 'react-hook-form'; | ||
|
||
import { Props } from '../types'; | ||
|
||
const Textarea = ({ name, ...props }: Props<TextareaProps>) => { | ||
const { register, formState } = useFormContext(); | ||
const { errors } = formState; | ||
|
||
const error = errors[name]?.message?.toString(); | ||
|
||
return <VaraTextarea {...props} {...register(name)} error={error} />; | ||
}; | ||
|
||
export { Textarea }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { InputProps as VaraInputProps } from '@gear-js/vara-ui'; | ||
|
||
type Props<T> = Omit<T, 'onChange' | 'onBlur'> & { | ||
name: string; | ||
}; | ||
|
||
type InputProps = Props<VaraInputProps>; | ||
|
||
export type { Props, InputProps }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { withAccount } from './with-account'; | ||
import { withApi } from './with-api'; | ||
|
||
export { withAccount, withApi }; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { PriceInput } from './price-input'; | ||
import { SearchInput } from './search-input'; | ||
|
||
export { PriceInput, SearchInput }; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import VaraSVG from '@/assets/vara.svg?react'; | ||
|
||
import { Input, InputProps } from '../../form'; | ||
|
||
function PriceInput(props: Omit<InputProps, 'type' | 'icon'>) { | ||
return <Input type="number" step="any" icon={VaraSVG} {...props} />; | ||
} | ||
|
||
export { PriceInput }; |
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
frontend/src/components/layout/error-boundary/error-boundary.module.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.heading { | ||
margin-bottom: 16px; | ||
|
||
font-size: 32px; | ||
} | ||
|
||
.error { | ||
margin-bottom: 64px; | ||
|
||
font-size: 16px; | ||
color: #535352; | ||
} |
Oops, something went wrong.