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(client): keymap box 구현 #199

Merged
merged 1 commit into from
Dec 5, 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
86 changes: 86 additions & 0 deletions apps/client/src/components/Keymap.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import { Box, Paper, Stack, Typography, useTheme } from '@mui/material';
import { styled } from '@mui/material/styles';

// 키 맵 항목을 위한 스타일링된 컴포넌트
const KeyMapItem = styled(Stack)(({ theme }) => ({
alignItems: 'center',
marginBottom: theme.spacing(1),
}));

// 키 표시를 위한 스타일링된 박스
const KeyBox = styled(Box)(({ theme }) => ({
border: `1px solid ${theme.palette.divider}`,
borderRadius: '4px',
padding: '4px 8px',
backgroundColor: theme.palette.background.paper,
marginRight: theme.spacing(1),
display: 'inline-block',
}));

const KeyMap = () => {
const theme = useTheme();

return (
<Box
sx={{
position: 'fixed',
bottom: theme.spacing(2),
right: theme.spacing(2),
zIndex: 1300,
}}
>
<Paper
elevation={3}
sx={{
padding: theme.spacing(2),
backgroundColor: theme.palette.background.paper,
opacity: 0.9,
}}
>
<Typography variant="h6" gutterBottom>
Shortcut Key
</Typography>
<Stack spacing={1}>
<KeyMapItem direction="row" spacing={1}>
<KeyBox>Space</KeyBox>
<Typography variant="body2">+</Typography>
<KeyBox>Drag</KeyBox>
<Typography variant="body2" sx={{ marginLeft: 'auto' }}>
: Pan 기능
</Typography>
</KeyMapItem>
<KeyMapItem direction="row" spacing={1}>
<KeyBox>Wheel</KeyBox>
<Typography variant="body2" sx={{ marginLeft: 'auto' }}>
: 줌 인/아웃
</Typography>
</KeyMapItem>
<KeyMapItem direction="row" spacing={1}>
<KeyBox>Ctrl</KeyBox>
<Typography variant="body2">+</Typography>
<KeyBox>Click</KeyBox>
<Typography variant="body2" sx={{ marginLeft: 'auto' }}>
: Edge 분할
</Typography>
</KeyMapItem>
<KeyMapItem direction="row" spacing={1}>
<KeyBox>Double Click</KeyBox>
<Typography variant="body2" sx={{ marginLeft: 'auto' }}>
: Edge 전체 선택
</Typography>
</KeyMapItem>
<KeyMapItem direction="row" spacing={1}>
<KeyBox>Select</KeyBox>
<Typography variant="body2">+</Typography>
<KeyBox>Backspace</KeyBox>
<Typography variant="body2" sx={{ marginLeft: 'auto' }}>
: 삭제
</Typography>
</KeyMapItem>
</Stack>
</Paper>
</Box>
);
};

export default KeyMap;
2 changes: 2 additions & 0 deletions apps/client/src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Box } from '@mui/material';
import { Outlet } from 'react-router-dom';
import Header from './Header';
import Sidebar from './Sidebar';
import KeyMap from '@components/Keymap';

export default () => {
return (
Expand All @@ -28,6 +29,7 @@ export default () => {
</Box>
</Box>

<KeyMap />
<NetworksBar />
<PropertiesBar />
</>
Expand Down
Loading