Skip to content

Commit

Permalink
Merge pull request #205 from Nexters/base/mvp-8th
Browse files Browse the repository at this point in the history
[base -> develop] 8차 MVP
  • Loading branch information
alstn2468 authored Oct 10, 2024
2 parents 57a9d7d + b9fe5fa commit 6b26ca3
Show file tree
Hide file tree
Showing 78 changed files with 3,050 additions and 436 deletions.
89 changes: 89 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion apps/admin/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
} from './pages';
import ShowAddPage from './pages/ShowAddPage';
import { Suspense } from 'react';
import { domAnimation, LazyMotion } from 'framer-motion';

setDefaultOptions({ locale: ko });

Expand Down Expand Up @@ -142,7 +143,9 @@ const routes: RouteObject[] = [
element: (
<QueryClientProvider>
<BooltiUIProvider>
<Outlet />
<LazyMotion features={domAnimation}>
<Outlet />
</LazyMotion>
</BooltiUIProvider>
</QueryClientProvider>
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled'
import { mq_lg } from '@boolti/ui'
import styled from '@emotion/styled';
import { mq_lg } from '@boolti/ui';

interface LabelProps {
required?: boolean;
Expand All @@ -17,15 +17,15 @@ const LinkForm = styled.form`
${mq_lg} {
padding: 0;
}
`
`;

const LinkFormControl = styled.div`
margin-bottom: 28px;
& > div {
width: 100%;
}
`
`;

const LinkFormButtonWrapper = styled.div<LinkFormButtonWrapperProps>`
display: flex;
Expand All @@ -35,15 +35,15 @@ const LinkFormButtonWrapper = styled.div<LinkFormButtonWrapperProps>`
margin-top: 4px;
button {
width: ${({ isEditMode }) => isEditMode ? 'auto' : '100%'};
width: ${({ isEditMode }) => (isEditMode ? 'auto' : '100%')};
}
${mq_lg} {
button {
width: auto;
}
}
`
`;

const Label = styled.label<LabelProps>`
${({ theme }) => theme.typo.b3};
Expand All @@ -53,7 +53,7 @@ const Label = styled.label<LabelProps>`
position: relative;
&::after {
content: ${({ required }) => (required ? "'*'" : "none")};
content: ${({ required }) => (required ? "'*'" : 'none')};
color: ${({ theme }) => theme.palette.status.error};
${({ theme }) => theme.typo.b1};
line-height: 22px;
Expand All @@ -66,12 +66,12 @@ const LinkDeleteButton = styled.button`
line-height: 22px;
text-decoration: underline;
cursor: pointer;
`
`;

export default {
LinkForm,
LinkFormControl,
LinkFormButtonWrapper,
Label,
LinkDeleteButton
}
LinkDeleteButton,
};
25 changes: 17 additions & 8 deletions apps/admin/src/components/LinkFormDialogContent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
import { useForm } from 'react-hook-form';
import Styled from './LinkFormDialogContent.styles';
import { Button, TextField } from '@boolti/ui';
import { UserProfileLink } from '@boolti/api';
import { UserLink } from '@boolti/api';

export type LinkFormInputs = UserProfileLink;
export type LinkFormInputs = UserLink;

interface LinkFormDialogContentProps {
defaultValues?: LinkFormInputs;
onSubmit: (data: LinkFormInputs) => void;
onDelete?: () => void;
}

const LinkFormDialogContent = ({ defaultValues, onSubmit, onDelete }: LinkFormDialogContentProps) => {
const LinkFormDialogContent = ({
defaultValues,
onSubmit,
onDelete,
}: LinkFormDialogContentProps) => {
const linkForm = useForm<LinkFormInputs>({
defaultValues
defaultValues,
});

const isEditMode = !!defaultValues;
Expand All @@ -23,7 +27,7 @@ const LinkFormDialogContent = ({ defaultValues, onSubmit, onDelete }: LinkFormDi
title: data.title.trim(),
link: data.link.trim(),
});
}
};

return (
<Styled.LinkForm onSubmit={linkForm.handleSubmit(submitHandler)}>
Expand All @@ -47,7 +51,12 @@ const LinkFormDialogContent = ({ defaultValues, onSubmit, onDelete }: LinkFormDi
/>
</Styled.LinkFormControl>
<Styled.LinkFormButtonWrapper isEditMode={isEditMode}>
<Button size="bold" colorTheme="primary" type="submit" disabled={!linkForm.formState.isValid}>
<Button
size="bold"
colorTheme="primary"
type="submit"
disabled={!linkForm.formState.isValid}
>
저장하기
</Button>
{isEditMode && onDelete && (
Expand All @@ -57,7 +66,7 @@ const LinkFormDialogContent = ({ defaultValues, onSubmit, onDelete }: LinkFormDi
)}
</Styled.LinkFormButtonWrapper>
</Styled.LinkForm>
)
}
);
};

export default LinkFormDialogContent;
Loading

0 comments on commit 6b26ca3

Please sign in to comment.