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(ui): usertable horizontal scroll, agenda section gap, #370

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
4 changes: 3 additions & 1 deletion .husky/pre-commit
donghyo1234 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged
pnpm lint-staged

2 changes: 1 addition & 1 deletion client/src/components/atoms/Scroll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const Scroll = styled.div<{ hide?: boolean }>`
height: 100%;

overflow-y: scroll;
overflow-x: hidden;
overflow-x: scroll;
donghyo1234 marked this conversation as resolved.
Show resolved Hide resolved

::-webkit-scrollbar {
width: 14px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AgendaTag } from "@/components/molecules/AgendaTag";

import { useAdminAgenda } from "@/services/admin-agenda";

import { row, center, justify, gap, text, w } from "@/styles";
import { row, center, justify, gap, text, w, column } from "@/styles";

const agendaTags = {
public: true,
Expand Down Expand Up @@ -39,9 +39,9 @@ export const AdminOngoingAgendaCard: React.FC<Props> = ({ agenda }) => {

return (
<Card onClick={openModal}>
<div css={[gap(8), w("fill")]}>
<div css={[gap(8), column, w("fill")]}>
<AgendaTag tags={agendaTags} admin />
<div css={gap(2)}>
<div css={[gap(2)]}>
<h1 css={[text.title2, text.black]}>{agenda.title}</h1>
<p css={[text.subtitle, text.gray500]}>{agenda.content}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { useAdminAgenda } from "@/services/admin-agenda";

import { gap, text, w } from "@/styles";
import { w, column, gap, text } from "@/styles";

const agendaTags = {
public: true,
Expand Down Expand Up @@ -44,7 +44,7 @@

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

Check warning on line 47 in client/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 @@ -54,9 +54,9 @@

return (
<Card onClick={openModal}>
<div css={[gap(8), w("fill")]}>
<div css={[gap(8), column, w("fill")]}>
<AgendaTag tags={agendaTags} admin />
<div css={gap(2)}>
<div css={[gap(2)]}>
<h1 css={[text.title2, text.black]}>{agenda.title}</h1>
<p css={[text.subtitle, text.gray500]}>{agenda.content}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { AdminAgenda } from "@biseo/interface/admin/agenda";
import { Card } from "@/components/atoms";
import { AgendaTag } from "@/components/molecules/AgendaTag";

import { gap, text } from "@/styles";
import { w, column, gap, text } from "@/styles";

const agendaTags = {
public: true,
Expand All @@ -24,15 +24,15 @@ export const AdminTerminatedAgendaCard: React.FC<Props> = ({ agenda }) => {

return (
<Card clickable onClick={openModal}>
<div css={gap(8)}>
<div css={[gap(8), column, w("fill")]}>
<AgendaTag
tags={{
public: agendaTags.public,
identified: agendaTags.identified,
votable: agendaTags.votable,
}}
/>
<div css={gap(2)}>
<div css={[gap(2), column]}>
<h1 css={[text.title2, text.black]}>{agenda.title}</h1>
<p css={[text.subtitle, text.gray500]}>{agenda.content}</p>
</div>
Expand Down
17 changes: 12 additions & 5 deletions client/src/components/molecules/AgendaCard/OngoingAgendaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {

import { useAgenda } from "@/services/agenda";

import { gap, row, justify, text, w } from "@/styles";
import { column, row, justify, text, w, gap } from "@/styles";

interface OngoingAgendaProps {
agenda: OngoingAgenda;
Expand Down Expand Up @@ -71,21 +71,28 @@ export const OngoingAgendaCard: React.FC<OngoingAgendaProps> = ({ agenda }) => {

return (
<Card primary bold>
<div css={gap(10)}>
<div css={gap(8)}>
<div
css={{
gap: 10,
width: "100%",
display: "flex",
flexDirection: "column",
}}
>
<div css={[gap(8), column]}>
<AgendaTag
tags={{
public: agendaTags.public,
identified: agendaTags.identified,
votable: agenda.user.votable,
}}
/>
<div css={gap(2)}>
<div css={[gap(2), column]}>
<h1 css={[text.title2, text.black]}>{agenda.title}</h1>
<p css={[text.subtitle, text.gray500]}>{agenda.content}</p>
</div>
</div>
<div css={gap(6)}>
<div css={[gap(6), column]}>
<p css={[text.body, text.blue600]}>{agenda.resolution}</p>
{choices}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { PreparingAgenda } from "@biseo/interface/agenda";
import { Card } from "@/components/atoms";
import { AgendaTag } from "@/components/molecules/AgendaTag";

import { gap, text } from "@/styles";
import { w, gap, column, text } from "@/styles";

const agendaTags = {
public: true,
Expand All @@ -19,15 +19,15 @@ interface Props {

export const PreparingAgendaCard: React.FC<Props> = ({ agenda }) => (
<Card>
<div css={gap(8)}>
<div css={[gap(8), column, w("fill")]}>
<AgendaTag
tags={{
public: agendaTags.public,
identified: agendaTags.identified,
votable: agenda.user.votable,
}}
/>
<div css={gap(2)}>
<div css={[gap(2), column]}>
<h1 css={[text.title2, text.black]}>{agenda.title}</h1>
<p css={[text.subtitle, text.gray500]}>{agenda.content}</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { VoteResult } from "@/components/molecules/VoteResult";
import { VoteDetail } from "@/components/molecules/VoteDetail";
import { VoteParticipate } from "@/components/molecules/VoteParticipate";

import { gap, text, w } from "@/styles";
import { column, gap, text, w } from "@/styles";

const agendaTags = {
public: true,
Expand Down Expand Up @@ -41,8 +41,15 @@ export const TerminatedAgendaCard: React.FC<Props> = ({ agenda }) => {
}}
>
{enabled ? (
<div css={[gap(15), w("fill")]}>
<div css={gap(2)}>
<div
css={{
gap: 15,
width: "100%",
display: "flex",
flexDirection: "column",
}}
>
<div css={[gap(2), column]}>
<h1 css={[text.title2, text.black]}>{agenda.title}</h1>
<p css={[text.subtitle, text.gray500]}>{agenda.content}</p>
</div>
Expand Down Expand Up @@ -74,15 +81,15 @@ export const TerminatedAgendaCard: React.FC<Props> = ({ agenda }) => {
<VoteDetail type={agendaTags.identified} />
</div>
) : (
<div css={gap(8)}>
<div css={[gap(8), column, w("fill")]}>
<AgendaTag
tags={{
public: agendaTags.public,
identified: agendaTags.identified,
votable: agenda.user.votable,
}}
/>
<div css={gap(2)}>
<div css={[gap(2)]}>
<h1 css={[text.title2, text.black]}>{agenda.title}</h1>
<p css={[text.subtitle, text.gray500]}>{agenda.content}</p>
</div>
Expand Down
7 changes: 3 additions & 4 deletions client/src/components/organisms/UserTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { useEffect, useState, useMemo } from "react";

import {
Box,
Body,
Header,
Table,
Cell,
Expand Down Expand Up @@ -132,7 +131,7 @@ export const UserTable: React.FC<Props> = ({
</Row>
</Header>
<Scroll>
<Body>
<Box w={298}>
{filteredUsers.map(user => (
<Row
key={user.id}
Expand All @@ -155,15 +154,15 @@ export const UserTable: React.FC<Props> = ({
)}
<Cell w={60}>{user.displayName}</Cell>
<Cell w={100}>{user.username}</Cell>
<Cell>
<Cell w="hug">
{/* {user.isAdmin ? <UserTag>어드민</UserTag> : <></>} */}
{user.tags.map(tag => (
<UserTag key={tag} tag={tag} />
))}
</Cell>
</Row>
))}
</Body>
</Box>
</Scroll>
</Table>
</Box>
Expand Down
Loading