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

Feat/minor UI updates #470

Merged
merged 4 commits into from
Mar 27, 2024
Merged
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
12 changes: 9 additions & 3 deletions packages/web/src/components/atoms/Divider.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
import { css } from "@emotion/react";
import styled from "@emotion/styled";
import type { Color } from "@biseo/web/theme";

export const Divider = styled.hr<{
dir?: "horizontal" | "vertical";
color?: Color;
}>(
({ dir = "horizontal", theme }) => css`
({ dir = "horizontal", color = "gray300", theme }) => css`
border: none;
${dir === "horizontal"
? css`
width: 100%;
border-bottom: 1px solid ${theme.colors.gray300};
height: 1px;
border: none;
background-color: ${theme.colors[color]};
`
: css`
width: 1px;
height: 100%;
border-right: 1px solid ${theme.colors.gray300};
border: none;
background-color: ${theme.colors[color]};
`}
`,
);
4 changes: 3 additions & 1 deletion packages/web/src/components/atoms/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const Cell = styled.td<{ w?: Size; scroll?: boolean }>(
padding: 6px 5px;
font-size: 10px;
font-weight: 500;
line-break: anywhere;
Copy link
Collaborator

Choose a reason for hiding this comment

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

이거 anywhere인 이유가 있을까요?

Cell이 width가 작아서 줄 바꿈이 자주 일어나는 환경인지?
다른 line-break 스타일 (word 등)과 비교해서 어떤 점을 바탕으로 고르시게 되었나요?

Copy link
Collaborator

Choose a reason for hiding this comment

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

line-break는 anywhere이 맞을 것 같네요 이슈 #446에 첨부해주신거 보니

Copy link
Member Author

@yumincho yumincho Mar 13, 2024

Choose a reason for hiding this comment

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

table 칸에 들어가는 요소가 주로 띄어쓰기가 없이 작성되는 이름, 닉네임이라 anywhere로 작성했습니다.

image

참고로 이슈 #446 은 다른 분이 작업 중이라고 하셔서 (제욱이?) closed issue에 추가하지 않았습니다!

`,
);

Expand Down Expand Up @@ -45,7 +46,8 @@ export const Body = styled.tbody`
export const Row = styled.tr<{ selected?: boolean }>`
position: relative;
display: flex;
height: 32px;
min-height: 32px;
height: fit-content;
align-items: center;
gap: 5px;
background-color: ${props =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const AdminOngoingAgendaCard: React.FC<Props> = ({ agenda }) => {
};

return (
<Card onClick={openModal}>
<Card clickable onClick={openModal}>
<div css={[column, gap(8), w("fill")]}>
<AgendaTag tags={agendaTags} admin />
<div css={[column, gap(2)]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

const startVote = (e: React.MouseEvent<HTMLButtonElement>) => {
if (!validated) {
alert("투표 대상을 설정해주세요");

Check warning on line 47 in packages/web/src/components/molecules/AgendaCard/AdminPreparingAgendaCard.tsx

View workflow job for this annotation

GitHub Actions / Lint and Format (18.x, 8.x)

Unexpected alert
// TODO: button 아래 card click으로 간주되어 edit modal로의 redirection 때문에 alert가 뜨지 않음
return;
}
Expand All @@ -53,7 +53,7 @@
};

return (
<Card onClick={openModal}>
<Card clickable onClick={openModal}>
<div css={[column, gap(8), w("fill")]}>
<AgendaTag tags={agendaTags} admin />
<div css={[column, gap(2)]}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const AgendaTemplateCard: React.FC<Props> = ({ template }) => {
const openModal = () => navigate(`templateEdit?templateId=${template.id}`);

return (
<Card onClick={openModal}>
<Card clickable onClick={openModal}>
<Box gap={8} w="fill">
<AdminTag tags={adminTags} suffix={template.choices.length} />
<Box gap={11}>
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/components/molecules/ChatInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const formStyle = css`
${bg.white}
${border.gray300}
${round.md}
${align.center}
`;

const textAreaScrollStyle = css`
Expand Down
55 changes: 31 additions & 24 deletions packages/web/src/components/molecules/ModalInnerTextBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,24 @@ import {
Button,
Clickable,
TaggersBox,
Divider,
} from "@biseo/web/components/atoms";
import "@biseo/web/components/atoms/placeholder.css";
import { TrashIcon } from "@biseo/web/assets";
import { css } from "@emotion/react";
import { scroll, scrollBar } from "@biseo/web/styles";
import {
w,
h,
padding,
scroll,
scrollBar,
bg,
align,
column,
gap,
border,
round,
} from "@biseo/web/styles";

interface ModalInnerProps extends PropsWithChildren {
title: string;
Expand Down Expand Up @@ -185,11 +198,8 @@ const TextButton: React.FC<SubmitProps> = ({
}) => (
<BorderedBox
w={300}
borderColor="gray200"
bg="gray100"
borderSize={1}
roundBot={5}
roundTop={0}
borderStyle="solid"
dir="row"
align="center"
Expand Down Expand Up @@ -269,30 +279,27 @@ const AddVoteOptionArea: React.FC<SubmitProps> = ({
onClick,
onSubmit,
}) => (
<Box w={300}>
<BorderedBox
borderColor="gray200"
bg="white"
w="fill"
h={152}
borderSize={1}
pad={10}
padRight={0}
roundBot={0}
roundTop={5}
borderStyle="solid"
align="stretch"
<div css={[w(300), border.gray200, round.md, `overflow: hidden`]}>
<div
css={[
bg.white,
w("fill"),
h(152),
padding(10),
column,
align.stretch,
scroll.y,
scrollBar,
gap(10),
]}
>
<Scroll>
<Box w="fill" gap={10}>
{children}
</Box>
</Scroll>
</BorderedBox>
{children}
</div>
<Divider color="gray200" />
<TextButton onClick={onClick} onSubmit={onSubmit} value={value}>
새로운 항목
</TextButton>
</Box>
</div>
);
ModalInner.AddVoteOptionArea = AddVoteOptionArea;

Expand Down
Loading