MCPcopy Create free account
hub / github.com/dailydotdev/apps / dividerFor

Function dividerFor

packages/shared/src/components/share/SplitShareButton.tsx:69–89  ·  view source on GitHub ↗
(variant: ButtonVariant)

Source from the content-addressed store, hash-verified

67 * no `current` key, so it compiles to nothing at all.
68 */
69const dividerFor = (variant: ButtonVariant): string | false => {
70 // Sits on a solid fill, where only the label colour is guaranteed to read.
71 if (variant === ButtonVariant.Primary) {
72 return classNames(
73 DIVIDER_BASE,
74 'before:inset-y-0 before:bg-[color-mix(in_srgb,var(--button-color,var(--button-default-color)),transparent_80%)]',
75 );
76 }
77
78 // A bare ghost button: a full-height rule would float with nothing to anchor
79 // it, so it gets a shorter one in the colour `tailwind/buttons.ts` gives the
80 // Subtle variant's border.
81 if (variant === ButtonVariant.Tertiary) {
82 return classNames(
83 DIVIDER_BASE,
84 'before:inset-y-1.5 before:bg-[color-mix(in_srgb,var(--theme-border-subtlest-primary),transparent_70%)]',
85 );
86 }
87
88 return false;
89};
90
91/**
92 * Two real buttons that read as one control: the left half runs the primary

Callers 1

SplitShareButtonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected