Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
20d502f
Add styles and background props to mobile HandleBar
codynova Dec 4, 2025
1702029
Add handleBarVariant and styles prop to mobile Drawer, implement Hand…
codynova Dec 4, 2025
618464e
Add styles prop to mobile Tray
codynova Dec 4, 2025
fc1df63
Update mobile story Trays to allow customization
codynova Dec 4, 2025
546d014
Create mobile TrayHandleBarInside story
codynova Dec 4, 2025
408e793
Rename mobile SelectChip story to AlphaSelectChip
codynova Dec 4, 2025
cb7bd89
Regenerate mobile routes
codynova Dec 4, 2025
8a9289e
Update mobile Drawer styles
codynova Dec 4, 2025
2287596
Udate mobile Tray stories
codynova Dec 4, 2025
f583428
Fix mobile Drawer deps
codynova Dec 4, 2025
2193158
Tweak mobile Drawer to be more similar to web Tray
codynova Dec 5, 2025
873f5e8
Add web Tray styles and pin props, and implement pin
codynova Dec 5, 2025
c492f56
Update web Tray stories with pin prop
codynova Dec 5, 2025
49eac8f
Clean up mobile Drawer prop defaults
codynova Dec 5, 2025
f26c91f
Simplify mobile Tray title elements
codynova Dec 5, 2025
f1b3c16
Fix web Tray borderRadius and add TO DO comments
codynova Dec 5, 2025
7109027
Update web Tray stories
codynova Dec 5, 2025
364be1e
Fix web Tray scrolling with long content
codynova Dec 5, 2025
e35f4d4
Rename titleContainer to header
codynova Dec 5, 2025
c4b0086
Add hideHeader prop to web Tray
codynova Dec 5, 2025
a74b76e
Add Drawer's pin prop to Tray and implement it
codynova Dec 5, 2025
82f5751
Fix mobile pin and children types to be optional
codynova Dec 5, 2025
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
10 changes: 10 additions & 0 deletions apps/mobile-app/scripts/utils/routes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export const routes = [
getComponent: () =>
require('@coinbase/cds-mobile/alpha/select/__stories__/AlphaSelect.stories').default,
},
{
key: 'AlphaSelectChip',
getComponent: () =>
require('@coinbase/cds-mobile/alpha/select-chip/__stories__/AlphaSelectChip.stories').default,
},
{
key: 'AlphaTabbedChips',
getComponent: () =>
Expand Down Expand Up @@ -775,6 +780,11 @@ export const routes = [
getComponent: () =>
require('@coinbase/cds-mobile/overlays/__stories__/TrayFeedCard.stories').default,
},
{
key: 'TrayHandleBarInside',
getComponent: () =>
require('@coinbase/cds-mobile/overlays/__stories__/TrayHandleBarInside.stories').default,
},
{
key: 'TrayInformational',
getComponent: () =>
Expand Down
12 changes: 11 additions & 1 deletion apps/mobile-app/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ export const routes = [
getComponent: () =>
require('@coinbase/cds-mobile/alpha/select/__stories__/AlphaSelect.stories').default,
},
{
key: 'AlphaSelectChip',
getComponent: () =>
require('@coinbase/cds-mobile/alpha/select-chip/__stories__/AlphaSelectChip.stories').default,
},
{
key: 'AlphaTabbedChips',
getComponent: () =>
Expand Down Expand Up @@ -539,7 +544,7 @@ export const routes = [
{
key: 'SelectChip',
getComponent: () =>
require('@coinbase/cds-mobile/alpha/select-chip/__stories__/SelectChip.stories').default,
require('@coinbase/cds-mobile/chips/__stories__/SelectChip.stories').default,
},
{
key: 'SelectOption',
Expand Down Expand Up @@ -775,6 +780,11 @@ export const routes = [
getComponent: () =>
require('@coinbase/cds-mobile/overlays/__stories__/TrayFeedCard.stories').default,
},
{
key: 'TrayHandleBarInside',
getComponent: () =>
require('@coinbase/cds-mobile/overlays/__stories__/TrayHandleBarInside.stories').default,
},
{
key: 'TrayInformational',
getComponent: () =>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';

import { Example, ExampleScreen } from '../../examples/ExampleScreen';
import { useTheme } from '../../hooks/useTheme';

import { ScrollableTray } from './Trays';

export const TrayHandleBarInside = () => {
const theme = useTheme();
return (
<ExampleScreen>
<Example title="Tray with Handle Bar Inside">
<ScrollableTray
handleBarVariant="inside"
title="Tray with Handle Bar Inside"
verticalDrawerPercentageOfView={0.9}
/>
</Example>
</ExampleScreen>
);
};

export default TrayHandleBarInside;
27 changes: 10 additions & 17 deletions packages/mobile/src/overlays/__stories__/Trays.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ import { Menu } from '../../controls/Menu';
import { SelectOption } from '../../controls/SelectOption';
import { Fallback, VStack } from '../../layout';
import type { DrawerRefBaseProps } from '../drawer/Drawer';
import { Tray } from '../tray/Tray';
import { Tray, type TrayProps } from '../tray/Tray';

export const options: string[] = prices.slice(0, 4);

const lotsOfOptions: string[] = prices.slice(0, 30);

export const DefaultTray = ({ title }: { title?: React.ReactNode }) => {
export const DefaultTray = (props: Partial<TrayProps>) => {
const [isTrayVisible, setIsTrayVisible] = useState(true);
const setIsTrayVisibleOff = useCallback(() => setIsTrayVisible(false), [setIsTrayVisible]);
const setIsTrayVisibleOn = useCallback(() => setIsTrayVisible(true), [setIsTrayVisible]);
Expand All @@ -36,7 +36,7 @@ export const DefaultTray = ({ title }: { title?: React.ReactNode }) => {
ref={trayRef}
onCloseComplete={setIsTrayVisibleOff}
onVisibilityChange={handleTrayVisibilityChange}
title={title}
{...props}
>
<Menu onChange={setValue} value={value}>
{options.map((option: string) => (
Expand Down Expand Up @@ -65,14 +65,15 @@ const TrayFallbackContent = () => {
);
};

const spacingStyles = {
paddingBottom: 200,
};

export const ScrollableTray = ({
title,
fallbackEnabled,
verticalDrawerPercentageOfView,
}: {
title?: React.ReactNode;
...props
}: Partial<TrayProps> & {
fallbackEnabled?: boolean;
verticalDrawerPercentageOfView?: number;
}) => {
const [isTrayVisible, setIsTrayVisible] = useState(true);
const setIsTrayVisibleOff = useCallback(() => setIsTrayVisible(false), [setIsTrayVisible]);
Expand All @@ -88,13 +89,6 @@ export const ScrollableTray = ({
}
}, [isTrayVisible, fallbackEnabled]);

const spacingStyles = useMemo(
() => ({
paddingBottom: 200,
}),
[],
);

const handleOptionPress = useCallback(() => {
trayRef.current?.handleClose();
}, []);
Expand Down Expand Up @@ -122,8 +116,7 @@ export const ScrollableTray = ({
ref={trayRef}
disableCapturePanGestureToDismiss
onCloseComplete={setIsTrayVisibleOff}
title={title}
verticalDrawerPercentageOfView={verticalDrawerPercentageOfView}
{...props}
>
{isLoading ? (
<TrayFallbackContent />
Expand Down
Loading