-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #520 from sparcs-kaist/feat/anony
Feat/anony
- Loading branch information
Showing
20 changed files
with
318 additions
and
92 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
packages/api/prisma/migrations/20241127153936_create_categories/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- AlterTable | ||
ALTER TABLE `chat` ADD COLUMN `is_anon` BOOLEAN NOT NULL DEFAULT false; |
9 changes: 9 additions & 0 deletions
9
packages/api/prisma/migrations/20241202073949_alter_anon_flags/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `is_anon` on the `chat` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE `chat` DROP COLUMN `is_anon`, | ||
MODIFY `type` ENUM('message', 'notice', 'anonymous', 'adminnotice') NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { bg, center, h, padding, round, text, w } from "@biseo/web/styles"; | ||
import { css } from "@emotion/react"; | ||
|
||
export interface Props { | ||
label: string; | ||
position: "top" | "bottom"; | ||
} | ||
|
||
const BubbleStyle = css` | ||
${w("hug")} | ||
${h(24)} | ||
${center} | ||
${padding.horizontal(10)} | ||
${bg.black} | ||
${round.md} | ||
${text.option2} | ||
${text.white} | ||
position: absolute; | ||
left: 50%; | ||
transform: translate(-50%, 0%); | ||
white-space: nowrap; | ||
`; | ||
|
||
export const Bubble: React.FC<Props> = ({ label, position }: Props) => ( | ||
<div css={[BubbleStyle, position === "top" ? "bottom: 26px" : "top :26px"]}> | ||
{label} | ||
</div> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { useState, type PropsWithChildren } from "react"; | ||
import { center, h, w } from "@biseo/web/styles"; | ||
import { | ||
Bubble, | ||
type Props as BubbleProps, | ||
} from "@biseo/web/components/atoms/Bubble"; | ||
|
||
interface Props extends BubbleProps, PropsWithChildren {} | ||
|
||
export const BubbleItem: React.FC<Props> = ({ | ||
label, | ||
position, | ||
children = null, | ||
}) => { | ||
const [hover, setHover] = useState<boolean>(false); | ||
|
||
return ( | ||
<div | ||
css={[center, w("hug"), h("hug"), "position: relative"]} | ||
onPointerEnter={() => { | ||
setHover(true); | ||
}} | ||
onPointerLeave={() => { | ||
setHover(false); | ||
}} | ||
> | ||
{hover && <Bubble label={label} position={position} />} | ||
{children} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,54 @@ | ||
import React from "react"; | ||
import styled from "@emotion/styled"; | ||
import { Text } from "@biseo/web/components/atoms"; | ||
import { css } from "@emotion/react"; | ||
import { | ||
align, | ||
bg, | ||
colors, | ||
h, | ||
justify, | ||
padding, | ||
row, | ||
w, | ||
} from "@biseo/web/styles"; | ||
import { Megaphone } from "lucide-react"; | ||
|
||
interface Props { | ||
title: string; | ||
} | ||
|
||
const Container = styled.div` | ||
const containerStyle = css` | ||
${row} | ||
${w("fill")} | ||
${bg.gray100} | ||
${padding.horizontal(20)} | ||
${align.center} | ||
${justify.between} | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
width: "100%"; | ||
min-height: 42px; | ||
background-color: ${props => props.theme.colors.gray100}; | ||
padding: 0 20px; | ||
justify-content: center; | ||
`; | ||
|
||
const iconStyle = css` | ||
${row} | ||
${align.center} | ||
${justify.center} | ||
${w(24)} | ||
${h(24)} | ||
border-radius: 4px; | ||
cursor: pointer; | ||
&:hover { | ||
${bg.gray200} | ||
} | ||
`; | ||
|
||
export const ChatHeader: React.FC<Props> = ({ title }) => ( | ||
<Container> | ||
<div css={containerStyle}> | ||
<Text variant="title2">{title}</Text> | ||
</Container> | ||
<div css={iconStyle}> | ||
<Megaphone size={20} color={colors.gray400} /> | ||
</div> | ||
</div> | ||
); |
Oops, something went wrong.