Skip to content

Commit

Permalink
WEB-2113 initial draft
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Ladaria committed Dec 16, 2024
1 parent 3757136 commit 46da8a7
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/drawer.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,45 @@
// https://www.figma.com/design/NfM16IJ4ffPVEdiFbtU0Lu/%F0%9F%94%B8-Drawer-Specs?node-id=10-5397&t=58YG59t526tkk7dP-1
import * as React from 'react';
import Stack from './stack';
import {Text3, Text4, Text5} from './text';
import {vars} from './skins/skin-contract.css';
import {IconButton} from './icon-button';
import IconCloseRegular from './generated/mistica-icons/icon-close-regular';

type DrawerProps = {
title?: string;
subtitle?: string;
description?: string;
// actions?: React.ReactNode;
onDismiss?: () => void;
// overlay?: boolean;
};

const Drawer = ({title, subtitle, description, onDismiss}: DrawerProps): JSX.Element => {
const handleDismiss = () => {
onDismiss?.();
};

return (
<div>
<IconButton
onPress={handleDismiss}
Icon={IconCloseRegular}
aria-label="Close drawer"
type="neutral"
backgroundType="transparent"
></IconButton>
<Stack space={16}>
{title && <Text5>{title}</Text5>}
{subtitle && <Text4 regular>{subtitle}</Text4>}
{description && (
<Text3 regular color={vars.colors.textSecondary}>
{description}
</Text3>
)}
</Stack>
</div>
);
};

export default Drawer;

0 comments on commit 46da8a7

Please sign in to comment.