generated from GSM-MSG/MSG-Repository-Generator
-
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.
- Loading branch information
1 parent
897b206
commit f053a77
Showing
56 changed files
with
1,221 additions
and
334 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 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
143 changes: 0 additions & 143 deletions
143
packages/app/src/features/register/molecules/AuthenticationInputs/index.tsx
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
packages/app/src/features/register/molecules/AuthenticationInputs/style.ts
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
21 changes: 21 additions & 0 deletions
21
packages/app/src/features/register/queries/usePostFileMutation.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,21 @@ | ||
import { UseMutationOptions, useMutation } from '@tanstack/react-query' | ||
import { PostFileService } from '@features/register/services' | ||
|
||
interface Param { | ||
file: File | ||
isImage?: boolean | ||
} | ||
|
||
interface Props | ||
extends UseMutationOptions<string | undefined, Error, Param, unknown> {} | ||
|
||
const usePostFileMutation = ({ ...props }: Props) => { | ||
return useMutation({ | ||
mutationKey: ['post-file'], | ||
mutationFn: ({ file, isImage }: Param) => | ||
PostFileService(file, isImage ?? false), | ||
...props, | ||
}) | ||
} | ||
|
||
export default usePostFileMutation |
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
25 changes: 25 additions & 0 deletions
25
packages/app/src/features/student/atoms/ArrayController/index.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,25 @@ | ||
import { Chip, DeleteButton } from '@sms/shared' | ||
import * as S from './style' | ||
|
||
interface Props { | ||
onAddClick?: () => void | ||
onRemoveClick?: () => void | ||
disableAdd?: boolean | ||
} | ||
|
||
const ArrayController = ({ onAddClick, onRemoveClick, disableAdd }: Props) => { | ||
return ( | ||
<S.Wrapper> | ||
<Chip | ||
disabled={disableAdd} | ||
style={{ opacity: disableAdd ? 0 : undefined }} | ||
onClick={onAddClick} | ||
> | ||
추가 | ||
</Chip> | ||
<DeleteButton type='button' onClick={onRemoveClick} /> | ||
</S.Wrapper> | ||
) | ||
} | ||
|
||
export default ArrayController |
7 changes: 7 additions & 0 deletions
7
packages/app/src/features/student/atoms/ArrayController/style.ts
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,7 @@ | ||
import styled from '@emotion/styled' | ||
|
||
export const Wrapper = styled.div` | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
` |
36 changes: 36 additions & 0 deletions
36
packages/app/src/features/student/atoms/BooleanInput/index.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,36 @@ | ||
import { SegmentedControl } from '@sms/shared' | ||
import { useFormContext } from 'react-hook-form' | ||
import ErrorWrapper from '@sms/shared/src/atoms/ErrorWrapper' | ||
import { ErrorMessage } from '@hookform/error-message' | ||
import type { Field } from '@features/student/dtos/res/AuthenticationFromResDto' | ||
|
||
interface Props { | ||
field: Field | ||
name: string | ||
} | ||
|
||
const BooleanInput = ({ field, name }: Props) => { | ||
const { | ||
register, | ||
formState: { errors }, | ||
} = useFormContext() | ||
|
||
return ( | ||
<ErrorWrapper error={<ErrorMessage name={name} errors={errors} />}> | ||
<SegmentedControl.Root {...register(name)}> | ||
{ | ||
field.values?.map((value) => ( | ||
<SegmentedControl.Option | ||
key={value.selectId} | ||
value={value.selectId} | ||
> | ||
{value.value} | ||
</SegmentedControl.Option> | ||
)) as [] | ||
} | ||
</SegmentedControl.Root> | ||
</ErrorWrapper> | ||
) | ||
} | ||
|
||
export default BooleanInput |
Oops, something went wrong.