tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
28
pulls
pipelines
fixed issue with page options menu
cozylittle.house
10 months ago
3496f2d8
59b23017
+16
-12
1 changed file
expand all
collapse all
unified
split
components
Pages
index.tsx
+16
-12
components/Pages/index.tsx
···
1
"use client";
2
3
-
import React, { useState } from "react";
4
import { useUIState } from "src/useUIState";
5
import { useEntitySetContext } from "../EntitySetProvider";
6
import { useSearchParams } from "next/navigation";
···
241
);
242
};
243
244
-
const PageOptionButton = (props: {
245
-
onClick?: () => void;
0
0
0
0
0
0
246
children: React.ReactNode;
247
secondary?: boolean;
248
cardBorderHidden: boolean | undefined;
249
className?: string;
250
disabled?: boolean;
251
-
}) => {
252
return (
253
<button
254
className={`
···
256
shrink-0
257
pt-[2px] h-5 w-5 p-0.5 mx-auto
258
border border-border
259
-
${props.secondary ? "bg-border text-bg-page" : "bg-bg-page text-border"}
260
-
${props.disabled && "opacity-50"}
261
-
${props.cardBorderHidden ? "rounded-md" : `rounded-b-md sm:rounded-l-none sm:rounded-r-md`}
262
flex items-center justify-center
263
-
${props.className}
264
265
`}
266
-
onClick={() => {
267
-
props.onClick && props.onClick();
268
-
}}
269
>
270
-
{props.children}
271
</button>
272
);
273
};
···
1
"use client";
2
3
+
import React, { JSX, useState } from "react";
4
import { useUIState } from "src/useUIState";
5
import { useEntitySetContext } from "../EntitySetProvider";
6
import { useSearchParams } from "next/navigation";
···
241
);
242
};
243
244
+
const PageOptionButton = ({
245
+
children,
246
+
secondary,
247
+
cardBorderHidden,
248
+
className,
249
+
disabled,
250
+
...props
251
+
}: {
252
children: React.ReactNode;
253
secondary?: boolean;
254
cardBorderHidden: boolean | undefined;
255
className?: string;
256
disabled?: boolean;
257
+
} & Omit<JSX.IntrinsicElements["button"], "content">) => {
258
return (
259
<button
260
className={`
···
262
shrink-0
263
pt-[2px] h-5 w-5 p-0.5 mx-auto
264
border border-border
265
+
${secondary ? "bg-border text-bg-page" : "bg-bg-page text-border"}
266
+
${disabled && "opacity-50"}
267
+
${cardBorderHidden ? "rounded-md" : `rounded-b-md sm:rounded-l-none sm:rounded-r-md`}
268
flex items-center justify-center
269
+
${className}
270
271
`}
272
+
{...props}
0
0
273
>
274
+
{children}
275
</button>
276
);
277
};