Skip to content

Commit

Permalink
feat: 공연 삭제 버튼 활성화 조건 변경 및 danger 버튼 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
Puterism committed Jan 11, 2025
1 parent c7f2c49 commit 3f8288a
Show file tree
Hide file tree
Showing 14 changed files with 65 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const Label = styled.label<LabelProps>`
&::after {
content: ${({ required }) => (required ? "'*'" : 'none')};
color: ${({ theme }) => theme.palette.status.error};
color: ${({ theme }) => theme.palette.status.error1};
${({ theme }) => theme.typo.b1};
line-height: 22px;
margin-left: 2px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ const Label = styled.label<LabelProps>`
&::after {
content: ${({ required }) => (required ? "'*'" : 'none')};
color: ${({ theme }) => theme.palette.status.error};
color: ${({ theme }) => theme.palette.status.error1};
${({ theme }) => theme.typo.b1};
line-height: 22px;
margin-left: 2px;
Expand Down Expand Up @@ -319,7 +319,7 @@ const TextAreaWrapper = styled.div`
const TextAreaBox = styled.div<TextAreaProps>`
border: 1px solid
${({ theme, hasError }) =>
hasError ? `${theme.palette.status.error} !important` : theme.palette.grey.g20};
hasError ? `${theme.palette.status.error1} !important` : theme.palette.grey.g20};
border-radius: 4px;
background-color: ${({ theme }) => theme.palette.grey.w};
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/src/components/SettingDialogContent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ const SettingDialogContent = ({ onDeleteAccount }: SettingDialogContentProps) =>
</Styled.SettingDescriptionItem>
</Styled.SettingDescriptionList>
<Button
style={{ background: theme.palette.status.error }}
style={{ background: theme.palette.status.error1 }}
colorTheme="primary"
size="x-small"
onClick={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ShowInfoFormLabel = styled.span<ShowInfoFormLabelProps>`
&::after {
content: '*';
${({ theme }) => theme.typo.b3};
color: ${({ theme }) => theme.palette.status.error};
color: ${({ theme }) => theme.palette.status.error1};
display: ${({ required }) => (required ? 'inline' : 'none')};
margin-left: 2px;
}
Expand Down Expand Up @@ -53,7 +53,7 @@ const FieldWrap = styled.div`
const InputWrapper = styled.div<InputWrapperProps>`
${({ theme }) => theme.typo.b3};
border: 1px solid
${({ theme, isError }) => (isError ? theme.palette.status.error : theme.palette.grey.g20)};
${({ theme, isError }) => (isError ? theme.palette.status.error1 : theme.palette.grey.g20)};
border-radius: 4px;
background-color: ${({ theme }) => theme.palette.grey.w};
padding: 8px 36px 8px 12px;
Expand All @@ -67,7 +67,7 @@ const InputWrapper = styled.div<InputWrapperProps>`
&:focus-within {
border-color: ${({ theme, isError }) =>
isError ? theme.palette.status.error : theme.palette.grey.g70};
isError ? theme.palette.status.error1 : theme.palette.grey.g70};
}
`;

Expand Down Expand Up @@ -213,7 +213,7 @@ const ButtonWrap = styled.div`

const ErrorMessage = styled.span`
${({ theme }) => theme.typo.b1};
color: ${({ theme }) => theme.palette.status.error};
color: ${({ theme }) => theme.palette.status.error1};
`;

const DraggableShowCastInfoMemberRow = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const ShowInfoFormLabel = styled.label<ShowInfoFormLabelProps>`
&::after {
content: '*';
${({ theme }) => theme.typo.b3};
color: ${({ theme }) => theme.palette.status.error};
color: ${({ theme }) => theme.palette.status.error1};
display: ${({ required }) => (required ? 'inline' : 'none')};
margin-left: 2px;
}
Expand Down Expand Up @@ -137,7 +137,7 @@ const ShowInfoFormButtonContainer = styled.div`
gap: 8px;
`;

const ShowInfoFormButton = styled(Button)<ShowInfoFormButtonProps>`
const ShowInfoFormButton = styled(Button) <ShowInfoFormButtonProps>`
width: ${({ width }) => width};
`;

Expand Down Expand Up @@ -305,7 +305,7 @@ const TextArea = styled.textarea<TextAreaProps>`
padding: 12px;
border: 1px solid
${({ theme, hasError }) =>
hasError ? `${theme.palette.status.error} !important` : theme.palette.grey.g20};
hasError ? `${theme.palette.status.error1} !important` : theme.palette.grey.g20};
border-radius: 4px;
background-color: ${({ theme }) => theme.palette.grey.w};
color: ${({ theme }) => theme.palette.grey.g90};
Expand Down Expand Up @@ -335,7 +335,7 @@ const TextArea = styled.textarea<TextAreaProps>`
const TextAreaErrorMessage = styled.p`
margin-top: 4px;
${({ theme }) => theme.typo.b1};
color: ${({ theme }) => theme.palette.status.error};
color: ${({ theme }) => theme.palette.status.error1};
`;

const TicketGroup = styled.div`
Expand Down Expand Up @@ -366,7 +366,7 @@ const TicketGroupTitle = styled.h3<TicketGroupTitleProps>`
&::after {
content: '*';
${({ theme }) => theme.typo.b1};
color: ${({ theme }) => theme.palette.status.error};
color: ${({ theme }) => theme.palette.status.error1};
display: ${({ required }) => (required ? 'inline' : 'none')};
margin-left: 2px;
}
Expand Down Expand Up @@ -562,7 +562,7 @@ const MobileTicketAction = styled.div<MobileTicketActionProps>`
width: 24px;
height: 24px;
stroke: ${({ theme, disabled }) =>
disabled ? theme.palette.grey.g40 : theme.palette.grey.g90};
disabled ? theme.palette.grey.g40 : theme.palette.grey.g90};
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const DropdownListItem = styled.li<DropdownListItemProps>`
padding: 7px 12px;
${({ theme }) => theme.typo.b1};
color: ${({ isDelete, theme }) =>
isDelete ? theme.palette.status.error : theme.palette.grey.g70};
isDelete ? theme.palette.status.error1 : theme.palette.grey.g70};
background-color: ${({ theme }) => theme.palette.grey.w};
cursor: pointer;
margin-top: 0;
Expand Down
12 changes: 10 additions & 2 deletions apps/admin/src/components/ShowSettingDialogContent/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Styled from './ShowSettingDialogContent.styles';
import { useHostList } from '@boolti/api';
import { useHostList, useInvitationTicketList, useSalesTicketList } from '@boolti/api';
import HostInputForm from './components/HostInputForm';
import { Button } from '@boolti/ui';
import { ChevronRightIcon } from '@boolti/icon';
Expand All @@ -19,6 +19,13 @@ const ShowSettingDialogContent = ({
onClickDeleteButton,
}: ShowSettingDialogContentProps) => {
const { data: hosts } = useHostList(showId);
const { data: salesTicketList } = useSalesTicketList(showId);
const { data: invitationTicketList } = useInvitationTicketList(showId);

const hasSoldSalesTicketAtLeastOnce = salesTicketList?.some(({ soldAtLeastOnce }) => soldAtLeastOnce)
const hasSoldInvitationTicket = invitationTicketList?.some(({ totalForSale }) => totalForSale > 0)
const isShowDeletable = !hasSoldSalesTicketAtLeastOnce && !hasSoldInvitationTicket

const [firstHost, ...restHosts] = hosts ?? [];

const [myHostInfo] = useAtom(myHostInfoAtom);
Expand Down Expand Up @@ -65,8 +72,9 @@ const ShowSettingDialogContent = ({
<Styled.DeleteButtonContainer>
<Button
type="button"
colorTheme="primary"
colorTheme="danger"
size="x-small"
disabled={!isShowDeletable}
onClick={onClickDeleteButton}
>
삭제하기
Expand Down
28 changes: 14 additions & 14 deletions apps/admin/src/pages/ShowAddPage/ShowAddPage.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const ShowAddFormLabel = styled.label<ShowAddFormLabelProps>`
&::after {
content: '*';
${({ theme }) => theme.typo.b3};
color: ${({ theme }) => theme.palette.status.error};
color: ${({ theme }) => theme.palette.status.error1};
display: ${({ required }) => (required ? 'inline' : 'none')};
margin-left: 2px;
}
Expand All @@ -183,7 +183,7 @@ const ShowAddFormButtonContainer = styled.div`
gap: 8px;
`;

const ShowAddFormButton = styled(Button)<ShowAddFormButtonProps>`
const ShowAddFormButton = styled(Button) <ShowAddFormButtonProps>`
${({ variant }) => {
switch (variant) {
case 'next': {
Expand All @@ -207,24 +207,24 @@ const ShowAddFormButton = styled(Button)<ShowAddFormButtonProps>`
${mq_lg} {
${({ variant }) => {
switch (variant) {
case 'next': {
return `
switch (variant) {
case 'next': {
return `
width: calc(100% - 152px);
`;
}
case 'prev': {
return `
}
case 'prev': {
return `
width: 152px;
`;
}
default: {
return `
}
default: {
return `
width: 100%;
`;
}
}
}};
}
}};
}
`;

Expand Down Expand Up @@ -405,7 +405,7 @@ const Term = styled.div`
align-items: center;
`;

const TermLabel = styled(Checkbox.Label)<{ main?: boolean }>`
const TermLabel = styled(Checkbox.Label) <{ main?: boolean }>`
display: flex;
align-items: center;
gap: 8px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const TableItem = styled.div<TableItemProps>`

const EntranceStateText = styled.p<EntranceStateTextProps>`
color: ${({ complete, theme }) =>
complete ? theme.palette.status.success : theme.palette.status.error};
complete ? theme.palette.status.success : theme.palette.status.error1};
`;

const Empty = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const TableItem = styled.div<TableItemProps>`

const EntranceStateText = styled.p<EntranceStateTextProps>`
color: ${({ complete, theme }) =>
complete ? theme.palette.status.success : theme.palette.status.error};
complete ? theme.palette.status.success : theme.palette.status.error1};
`;

const Empty = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const StatusBadge = ({ status }: { status: SuperAdminShowStatus | 'ALL' }) => {
return {
label: '정산 중',
color: theme.palette.red.sub,
fontColor: theme.palette.status.error,
fontColor: theme.palette.status.error1,
};
case 'SETTLEMENT_DONE':
return {
Expand Down
18 changes: 17 additions & 1 deletion packages/ui/src/components/Button/Button.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled from '@emotion/styled';

type ColorTheme = 'primary' | 'netural' | 'line' | 'secondary';
type ColorTheme = 'primary' | 'netural' | 'line' | 'secondary' | 'danger';
type Size = 'bold' | 'medium' | 'regular' | 'small' | 'x-small';

export interface ButtonProps {
Expand Down Expand Up @@ -130,6 +130,22 @@ const Container = styled.button<ButtonProps>`
background-color: ${theme.palette.grey.g00};
}
`;
case 'danger':
return `
color: ${theme.palette.grey.w};
border: 0;
background-color: ${theme.palette.status.error1};
&:hover:not(:disabled) {
background-color: ${theme.palette.status.error2};
}
&:active:not(:disabled) {
background-color: ${theme.palette.status.error3};
}
&:disabled {
color: ${theme.palette.grey.g40};
background-color: ${theme.palette.grey.g20};
}
`
}
}}
`;
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/components/TextField/TextField.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const InputLabel = styled.label<{ hasError?: boolean; disabled?: boolean; hasVal
padding: 12px 13px;
color: ${({ theme }) => theme.palette.grey.g90};
border: 1px solid
${({ hasError, theme }) => (hasError ? theme.palette.status.error : theme.palette.grey.g20)};
${({ hasError, theme }) => (hasError ? theme.palette.status.error1 : theme.palette.grey.g20)};
background: ${({ theme }) => theme.palette.grey.w};
${({ theme }) => theme.typo.b3};
Expand All @@ -72,7 +72,7 @@ const Input = styled.input<{ hasError?: boolean }>`
color: ${({ theme }) => theme.palette.grey.g90};
border: 1px solid
${({ hasError, theme }) =>
hasError ? `${theme.palette.status.error} !important` : theme.palette.grey.g20};
hasError ? `${theme.palette.status.error1} !important` : theme.palette.grey.g20};
background: ${({ theme }) => theme.palette.grey.w};
${({ theme }) => theme.typo.b3};
&:placeholder-shown {
Expand Down Expand Up @@ -136,7 +136,7 @@ const ButtonContainer = styled.div`
const ErrorMessage = styled.span`
margin-top: 4px;
${({ theme }) => theme.typo.b1};
color: ${({ theme }) => theme.palette.status.error};
color: ${({ theme }) => theme.palette.status.error1};
`;

export default {
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/systems/palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ const palette = {
o3: '#C93E02',
},
status: {
error: '#FF4D4F',
error1: '#FF4D4F',
error2: '#EC2C2E',
error3: '#DE0609',
warning: '#FAAD14',
success: '#52C41A',
link: '#1890FF',
Expand Down

0 comments on commit 3f8288a

Please sign in to comment.