tangled
alpha
login
or
join now
ajamesphillips.com
/
leaflet
forked from
leaflet.pub/leaflet
0
fork
atom
a tool for shared writing and social publishing
0
fork
atom
overview
issues
pulls
pipelines
fix share button, home button, and secondary button
awarm.space
11 months ago
e28ca260
70d2f41c
+19
-9
3 changed files
expand all
collapse all
unified
split
components
Buttons.tsx
HomeButton.tsx
Layout.tsx
+5
-4
components/Buttons.tsx
reviewed
···
68
68
} = props;
69
69
return (
70
70
<button
71
71
-
{...props}
71
71
+
{...buttonProps}
72
72
ref={ref}
73
73
className={`m-0 h-max
74
74
${fullWidth ? "w-full" : fullWidthOnMobile ? "w-full sm:w-max" : "w-max"}
···
96
96
compact?: boolean;
97
97
} & ButtonProps
98
98
>((props, ref) => {
99
99
+
let { fullWidth, children, compact, ...buttonProps } = props;
99
100
return (
100
101
<button
101
101
-
{...props}
102
102
+
{...buttonProps}
102
103
ref={ref}
103
103
-
className={`m-0 h-max ${props.fullWidth ? "w-full" : "w-max"} ${props.compact ? "px-0" : "px-1"}
104
104
+
className={`m-0 h-max ${fullWidth ? "w-full" : "w-max"} ${compact ? "px-0" : "px-1"}
104
105
bg-transparent text-base font-bold text-accent-contrast
105
106
flex gap-2 items-center justify-center shrink-0
106
107
hover:underline disabled:text-border
107
108
${props.className}
108
109
`}
109
110
>
110
110
-
{props.children}
111
111
+
{children}
111
112
</button>
112
113
);
113
114
});
+4
-4
components/HomeButton.tsx
reviewed
···
42
42
)
43
43
return null;
44
44
return (
45
45
-
<button
45
45
+
<ActionButton
46
46
onClick={async (e) => {
47
47
await addLeafletToHome(permission_token.id);
48
48
mutate((identity) => {
···
66
66
text: "Leaflet added to your home!",
67
67
});
68
68
}}
69
69
-
>
70
70
-
<ActionButton icon={<AddToHomeSmall />} label="Add to Home" />
71
71
-
</button>
69
69
+
icon={<AddToHomeSmall />}
70
70
+
label="Add to Home"
71
71
+
/>
72
72
);
73
73
};
+10
-1
components/Layout.tsx
reviewed
···
2
2
import { theme } from "tailwind.config";
3
3
import { NestedCardThemeProvider } from "./ThemeManager/ThemeProvider";
4
4
import { PopoverArrow } from "./Icons/PopoverArrow";
5
5
+
import { PopoverOpenContext } from "./Popover";
6
6
+
import { useState } from "react";
5
7
6
8
export const Separator = (props: { classname?: string }) => {
7
9
return (
···
20
22
onOpenChange?: (o: boolean) => void;
21
23
asChild?: boolean;
22
24
}) => {
25
25
+
let [open, setOpen] = useState(props.open || false);
23
26
return (
24
24
-
<DropdownMenu.Root onOpenChange={props.onOpenChange} open={props.open}>
27
27
+
<DropdownMenu.Root
28
28
+
onOpenChange={(o) => {
29
29
+
setOpen(o);
30
30
+
props.onOpenChange?.(o);
31
31
+
}}
32
32
+
open={props.open}
33
33
+
>
25
34
<DropdownMenu.Trigger asChild={props.asChild}>
26
35
{props.trigger}
27
36
</DropdownMenu.Trigger>