Skip to content

Commit

Permalink
Merge pull request #200 from boostcampwm-2024/feature/fe/#194-userboard
Browse files Browse the repository at this point in the history
[FE][Feat] #194 : userboard ๊ตฌํ˜„
  • Loading branch information
leedongyull authored Nov 19, 2024
2 parents 795b38d + 068052c commit cfa9bf8
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
52 changes: 52 additions & 0 deletions frontend/src/component/userboard/UserBoard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import classNames from 'classnames';
import { HiLocationMarker } from 'react-icons/hi';

const users = [
{
name: '์‚ฌ์šฉ์ž1',
markerColor: 'text-marker-user1',
},
{
name: '์‚ฌ์šฉ์ž2',
markerColor: 'text-marker-user2',
},
{
name: '์‚ฌ์šฉ์ž3',
markerColor: 'text-marker-user3',
},
{
name: '์‚ฌ์šฉ์ž4',
markerColor: 'text-marker-user4',
},
{
name: '์‚ฌ์šฉ์ž5',
markerColor: 'text-marker-user5',
},
];
// mock๋ฐ์ดํ„ฐ ์ž‘์„ฑ, ์ถ”ํ›„ context ๋ฅผ ์ด์šฉํ•ด dropdown๊ณผ ์—ฐ๋™

/**
* UserBoard ์ปดํฌ๋„ŒํŠธ๋Š” ์ง€๋„ ์œ„ ์˜ค๋ฒ„๋ ˆ์ด๊ฐ€ ๋˜๋ฉฐ, ํ˜„์žฌ ๊ฒฝ๋กœ์˜ ์‚ฌ์šฉ์ž ๋ฐ ์„ ํƒ๋œ ์‚ฌ์šฉ์ž๋ฅผ ์ƒ‰์ƒ๊ณผ ํ•จ๊ป˜ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค.
* @remarks
* ํŒŒ๋ผ๋ฏธํ„ฐ ํ˜น์€ ์ „์—ญ ์ƒํƒœ๋กœ ๋ฐ›์€ ์œ ์ €๋ฅผ ์—ญ์ˆœ์œผ๋กœ ์•„๋ž˜๋ถ€ํ„ฐ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค.
* @example
* return (
* <UserBoard />
* )
*/

export const UserBoard = () => {
return (
<div className="absolute bottom-2.5 right-7 z-[4050] flex flex-col gap-1.5">
{users
.slice()
.reverse()
.map(user => (
<div className="flex flex-row items-center justify-center gap-1">
<HiLocationMarker className={classNames(user.markerColor, 'w-5', 'h-5')} />
<div className="text-2xs">{user.name}</div>
</div>
))}
</div>
);
};
24 changes: 24 additions & 0 deletions frontend/src/stories/userboard/userboard.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import '@/index.css';
import { Meta, StoryFn } from '@storybook/react';
import { UserBoard } from '@/component/userboard/UserBoard';

export default {
title: 'Components/UserBoard', // Storybook์˜ ์‚ฌ์ด๋“œ๋ฐ”์— ํ‘œ์‹œ๋  ๊ฒฝ๋กœ
component: UserBoard,
tags: ['autodocs'],
parameters: {
layout: 'fullscreen', // Storybook ๋ทฐ๋ฅผ ์ค‘์•™์— ์ •๋ ฌ
},
decorators: [
Story => (
<div style={{ position: 'relative', width: '100%', height: '100vh' }}>
<Story />
</div>
),
],
} as Meta;

const Template: StoryFn = args => <UserBoard {...args} />;

export const Default = Template.bind({});

0 comments on commit cfa9bf8

Please sign in to comment.