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

Fix disabled button UI #394

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion client/src/components/atoms/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export const Button = styled.button<{
}

&:disabled {
cursor: not-allowed;
cursor: none;
background-color: ${theme.colors.white};
}
`,
);
Expand Down
17 changes: 12 additions & 5 deletions client/src/components/organisms/CreateAgendaModal.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useEffect, useMemo, useState } from "react";
import { Link } from "react-router-dom";
import { w, h, text, colors } from "@/styles";

import {
Box,
Button,
SelectTagBox,
SelectTemplateBox,
Text,
} from "@/components/atoms";
import {
AdminAgendaTagsSelect,
Expand Down Expand Up @@ -198,10 +198,17 @@ export const CreateAgendaModal: React.FC = () => {
replace
style={{ textDecoration: "none" }}
>
<Button w={270} h={38} onClick={onSubmit} disabled={!validated}>
<Text variant="boldtitle3" color="blue600">
투표 생성하기
</Text>
<Button
css={[
w(270),
h(38),
text.boldtitle3,
validated ? colors.blue600 : colors.gray300,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Button이 이미 자체 style을 가지고 있는 상황이니까 Button 외부에서 스타일을 주입해주는것보다 내부에 disabled style variant를 가지도록 하는게 낫지 않을까요??

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 그리고 colors는 css prop이 아니라 그냥 색깔값이라서 이렇게 넣어주면 아무런 효과가 없을거에요!

아마 text.blue600이나 bg.blue600을 의도하신것 같아요

]}
onClick={onSubmit}
disabled={!validated}
>
투표 생성하기
</Button>
</Link>
</Box>
Expand Down
Loading