Skip to content

Commit cc70391

Browse files
committed
Add Dot component
1 parent 33cd7ac commit cc70391

File tree

2 files changed

+32
-0
lines changed
  • desktop/packages/mullvad-vpn/src/renderer/lib/components/dot

2 files changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import styled from 'styled-components';
2+
3+
import { Colors } from '../../foundations';
4+
5+
export interface DotProps {
6+
variant?: 'success' | 'warning' | 'error';
7+
size?: 'tiny' | 'small' | 'medium';
8+
}
9+
10+
const StyledDiv = styled.div<{ $size: string; $color: string }>`
11+
width: ${({ $size }) => $size};
12+
height: ${({ $size }) => $size};
13+
border-radius: 50%;
14+
background-color: ${({ $color }) => $color};
15+
`;
16+
17+
const sizes = {
18+
tiny: '8px',
19+
small: '10px',
20+
medium: '12px',
21+
};
22+
23+
const colors = {
24+
success: Colors.green,
25+
warning: Colors.yellow,
26+
error: Colors.red,
27+
};
28+
29+
export const Dot = ({ variant = 'success', size = 'medium', ...props }: DotProps) => {
30+
return <StyledDiv $size={sizes[size]} $color={colors[variant]} {...props} />;
31+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './Dot';

0 commit comments

Comments
 (0)