Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

๐Ÿ› ๏ธ ๊ณตํ†ต Button, Modal ์ปดํฌ๋„ŒํŠธ ์ˆ˜์ • #63

Merged
merged 23 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cd0e418
feat: ConfirmModalButton ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„
Legitgoons May 15, 2024
f61b2cd
feat: FollowButton ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„
Legitgoons May 15, 2024
497fedd
feat: ๊ธฐ์กด ๊ณต์šฉ ๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ ์‚ญ์ œ
Legitgoons May 15, 2024
de1aeec
feat: ButtonProps ์ˆ˜์ •
Legitgoons May 15, 2024
979bcef
feat: ๊ณตํ†ต ๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ ๊ด€๋ จ index ํŒŒ์ผ ์ˆ˜์ •
Legitgoons May 15, 2024
0182cce
feat: ConfirmModal ๋‚ด๋ถ€ Button ์ˆ˜์ •
Legitgoons May 15, 2024
4e3a724
feat: BaseModalProps ์‚ญ์ œ
Legitgoons May 15, 2024
c1b4ad6
feat: ConfirmModal.scss ๋ถ„๊ธฐ์ฒ˜๋ฆฌ ์‚ญ์ œ
Legitgoons May 15, 2024
5ad2750
feat: _colors.scss์— red ์ถ”๊ฐ€
Legitgoons May 15, 2024
0d74c2a
feat: ReportModalButton ์ปดํฌ๋„ŒํŠธ ๊ตฌํ˜„
Legitgoons May 15, 2024
ec4c3ea
feat: ConfirmReportModal ๋‚ด๋ถ€ ๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ ์ˆ˜์ •
Legitgoons May 15, 2024
5e4ade6
feat: BasicButton ์‚ญ์ œ
Legitgoons May 15, 2024
0e61208
fix: ConfirmModalButton.scss mixin ์ด๋ฆ„ ์ˆ˜์ •
Legitgoons May 15, 2024
8fdcc01
fix: ConfirmModalButton import scss ์ˆ˜์ •
Legitgoons May 15, 2024
31119ac
feat: ๊ณต์šฉ Button ์ปดํฌ๋„ŒํŠธ type ์ถ”๊ฐ€
Legitgoons May 15, 2024
e512f6a
fix: ReportModalButton scss import ๋ฐ ์˜ค๋ฅ˜ ์ˆ˜์ •
Legitgoons May 15, 2024
d5c6213
feat: ReportModalButton type ์ถ”๊ฐ€
Legitgoons May 15, 2024
c83b280
feat: BottomSheetModal ๋‚ด๋ถ€ button ์ˆ˜์ •
Legitgoons May 15, 2024
c4e86f3
fix: ReportModalButtonProps ์ด๋ฆ„ ์ˆ˜์ •
Legitgoons May 15, 2024
7cd18e9
feat: ReportModalButton ์‚ญ์ œ, ConfirmReportModal ๋‚ด๋ถ€ button ๊ตฌํ˜„
Legitgoons May 16, 2024
5302c0c
chore: ConfirmModalButton ์˜คํƒ€ ์ˆ˜์ •
Legitgoons May 16, 2024
5d16854
feat: ConfirmReportModal confirm-btn ์˜์‚ฌ ํด๋ž˜์Šค ์ ์šฉ
Legitgoons May 16, 2024
6508c44
style: ์˜์‚ฌ ํด๋ž˜์Šค ํ˜•์‹ ์ˆ˜์ •
Legitgoons May 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/features/feed-reports/ui/ConfirmReportModal.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
@mixin ReportModalButton() {
width: 118px;
height: 40px;
border-radius: 4px;
}

.confirm-report-modal {
display: flex;
flex-direction: column;
Expand All @@ -17,5 +23,22 @@
display: flex;
justify-content: center;
gap: 8px;

.confirm-btn {
color: white;
background-color: $red3;
@include ReportModalButton();

&:disabled {
color: $gray4;
background-color: $gray3;
}
}

.cancle-btn {
color: $gray4;
background-color: $gray2;
@include ReportModalButton();
}
}
}
14 changes: 7 additions & 7 deletions src/features/feed-reports/ui/ConfirmReportModal.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ActiveButton, BasicButton } from '@/shared/ui';
import { ModalOverlay } from '@/shared/ui/modal/ModalOverlay';

import './ConfirmReportModal.scss';
Expand All @@ -22,16 +21,17 @@ export const ConfirmReportModal: React.FC<ConfirmReportModalProps> = ({
<h3 className='title h3semi'>์‹ ๊ณ ํ•˜๊ธฐ</h3>
{children}
<div className='modal-btn-container'>
<BasicButton onClick={onClose} styleClass='confirm-cancle h4semi'>
<button onClick={onClose} className='cancle-btn h4semi' type='button'>
์ทจ์†Œ
</BasicButton>
<ActiveButton
</button>
<button
onClick={onExecute}
isDisabled={onExecuteIsDisabled}
styleClass='confirm h4semi'
disabled={onExecuteIsDisabled}
className='confirm-btn h4semi'
type='submit'
>
์‹ ๊ณ ํ•˜๊ธฐ
</ActiveButton>
</button>
</div>
</form>
</ModalOverlay>
Expand Down
3 changes: 3 additions & 0 deletions src/shared/styles/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ $gray7: #161a1d;
$mint1: #d9f9fb;
$mint2: #9deff6;
$mint3: #00d5e1;
$red1: #fff1f1;
$red2: #ff9999;
$red3: #ff6767;
53 changes: 0 additions & 53 deletions src/shared/ui/button/ActiveButton.scss

This file was deleted.

31 changes: 0 additions & 31 deletions src/shared/ui/button/ActiveButton.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions src/shared/ui/button/BasicButton.scss

This file was deleted.

24 changes: 0 additions & 24 deletions src/shared/ui/button/BasicButton.tsx

This file was deleted.

16 changes: 16 additions & 0 deletions src/shared/ui/button/ConfirmModalButton.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@mixin confirmModalButton() {
width: 97px;
height: 36px;
border-radius: 4px;
}

.confirm {
color: white;
background-color: $mint3;
@include confirmModalButton();
}
.cancle {
color: $gray4;
background-color: $gray2;
@include confirmModalButton();
}
20 changes: 20 additions & 0 deletions src/shared/ui/button/ConfirmModalButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { ButtonProps } from './types';
import './ConfirmModalButton.scss';

type ConfirmModalButtonStyle = 'confirm' | 'cancle';

interface ConfirmModalButtonProps extends ButtonProps {
styleClass: ConfirmModalButtonStyle;
}

export const ConfirmModalButton = ({
onClick,
children,
styleClass,
}: ConfirmModalButtonProps) => {
return (
<button onClick={onClick} type='button' className={`${styleClass} h4semi`}>
{children}
</button>
);
};
16 changes: 16 additions & 0 deletions src/shared/ui/button/FollowButton.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@mixin followButton() {
width: 48px;
height: 24px;
border-radius: 30px;
}

.follow {
color: white;
background-color: $gray5;
@include followButton();
}
.follow-unfollow {
color: white;
background-color: $mint3;
@include followButton();
}
20 changes: 20 additions & 0 deletions src/shared/ui/button/FollowButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import './FollowButton.scss';
import { ButtonProps } from './types';

interface FollowButtonProps extends ButtonProps {
isUnfollow: boolean;
}

export const FollowButton = ({
onClick,
isUnfollow,
children,
}: FollowButtonProps) => {
const sytleClass = isUnfollow ? 'follow' : 'follow-unfollow';

return (
<button onClick={onClick} type='button' className={`${sytleClass} b2semi`}>
{children}
</button>
);
};
4 changes: 2 additions & 2 deletions src/shared/ui/button/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { ActiveButton } from './ActiveButton';
export { BasicButton } from './BasicButton';
export { ConfirmModalButton } from './ConfirmModalButton';
export { FollowButton } from './FollowButton';
2 changes: 1 addition & 1 deletion src/shared/ui/button/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface ButtonProps {
onClick: () => void;
onClick: React.MouseEventHandler<HTMLButtonElement>;
children: React.ReactNode;
}
2 changes: 1 addition & 1 deletion src/shared/ui/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { ActiveButton, BasicButton } from './button';
export { FollowButton } from './button';
export { PageHeader } from './header';
export { ConfirmModal, BottomSheetModal } from './modal';
export { Profile, SkeletonProfile } from './profile';
Expand Down
19 changes: 19 additions & 0 deletions src/shared/ui/modal/BottomSheetModal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,30 @@
align-items: center;
border-radius: 4px;
}

.option-divider {
width: 244px;
margin: 0 auto;
border: none;
height: 0.5px;
background-color: $gray2;
}

.bsm-option {
width: 280px;
height: 46px;
color: $gray5;
text-align: center;
border-radius: 4px;
}

.bsm-cancle {
width: 280px;
height: 47px;
text-align: center;
background-color: $gray5;
color: white;
border-radius: 4px;
margin-top: 8px;
}
}
13 changes: 6 additions & 7 deletions src/shared/ui/modal/BottomSheetModal.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Fragment } from 'react/jsx-runtime';

import { BasicButton } from '../button/index';

import './BottomSheetModal.scss';
import { ModalOverlay } from './ModalOverlay';

Expand All @@ -25,19 +23,20 @@ export const BottomSheetModal = ({
<div className='modal-content'>
{options.map((option, index) => (
<Fragment key={index}>
<BasicButton
<button
onClick={option.onClick}
styleClass='bsm-option h4md'
type='button'
className='bsm-option h4md'
>
{option.label}
</BasicButton>
</button>
{index < options.length - 1 && <hr className='option-divider' />}
</Fragment>
))}
</div>
<BasicButton styleClass='bsm-cancle h4semi' onClick={onClose}>
<button className='bsm-cancle h4semi' type='button' onClick={onClose}>
์ทจ์†Œ
</BasicButton>
</button>
</div>
</ModalOverlay>
);
Expand Down
Loading
Loading