PluginProbe
Tableberg – Simple Gutenberg Table Block / 1.1.5
Tableberg – Simple Gutenberg Table Block v1.1.5
1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 trunk 0.0.2 0.2.1 0.3.2 0.3.3 0.4.1 0.5.0 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 All 42 releases
tableberg / src / components / SortPreviewBanner.tsx

SortPreviewBanner.tsx in Tableberg – Simple Gutenberg Table Block 1.1.5, at src/components/SortPreviewBanner.tsx

43 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { __ } from "@wordpress/i18n";
2 import { Button } from "@wordpress/components";
3 import { useTableStore } from "../store";
4
5 export function SortPreviewBanner() {
6 const sortPreviewMode = useTableStore(state => state.sortPreviewMode);
7 const exitSortPreviewMode = useTableStore(
8 state => state.exitSortPreviewMode
9 );
10
11 if (!sortPreviewMode) {
12 return null;
13 }
14
15 return (
16 <div
17 style={{
18 display: "flex",
19 alignItems: "center",
20 justifyContent: "space-between",
21 padding: "8px 12px",
22 backgroundColor: "#f0f0f1",
23 borderBottom: "1px solid #c3c4c7",
24 fontSize: "13px",
25 }}
26 >
27 <div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
28 <span
29 style={{
30 fontWeight: 500,
31 color: "#1e1e1e",
32 }}
33 >
34 {__("Sort Preview Mode", "tableberg")}
35 </span>
36 </div>
37 <Button variant="secondary" onClick={exitSortPreviewMode}>
38 {__("Exit Sorting Preview", "tableberg")}
39 </Button>
40 </div>
41 );
42 }
43