Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 5715e01

Browse files
committed
template to create settings button!
1 parent e21bfdc commit 5715e01

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

src/components/HeaderMenu.tsx

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import TrashIcon from "components/img/Trash";
1414
import TextIcon from "components/img/Text";
1515
import MultiIcon from "components/img/Multi";
1616
import HashIcon from "components/img/Hash";
17+
import AdjustmentsIcon from "components/img/AdjustmentsIcon";
1718
import React, { useContext, useEffect, useState } from "react";
1819
import { ActionType } from "react-table";
1920
import { usePopper } from "react-popper";
@@ -56,11 +57,16 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
5657
placement: "bottom",
5758
strategy: "absolute",
5859
});
60+
// Manage type of data
5961
const [typeReferenceElement, setTypeReferenceElement] = useState(null);
6062
const [typePopperElement, setTypePopperElement] = useState(null);
61-
6263
const [showType, setShowType] = useState(false);
6364

65+
// Manage settings
66+
const [settingsReferenceElement, setSettingsReferenceElement] =
67+
useState(null);
68+
const [settingsPopperElement, setSettingsPopperElement] = useState(null);
69+
const [showSettings, setShowSettings] = useState(false);
6470
useEffect(() => {
6571
if (created) {
6672
setExpanded(true);
@@ -350,6 +356,29 @@ const HeaderMenu = (headerMenuProps: HeaderMenuProps) => {
350356
</button>
351357
))}
352358
</div>
359+
<div
360+
style={{
361+
borderTop: `2px solid ${StyleVariables.BACKGROUND_DIVIDER}`,
362+
padding: "4px 0px",
363+
}}
364+
>
365+
{/** Column settings */}
366+
<div style={{ padding: "4px 0px" }}>
367+
<button
368+
className="sort-button"
369+
type="button"
370+
onMouseEnter={() => setShowSettings(true)}
371+
onMouseLeave={() => setShowSettings(false)}
372+
ref={setSettingsReferenceElement}
373+
>
374+
<span className="svg-icon svg-text icon-margin">
375+
<AdjustmentsIcon />
376+
</span>
377+
<span>Settings</span>
378+
</button>
379+
{showSettings && <span>pruebas</span>}
380+
</div>
381+
</div>
353382
</div>
354383
</div>
355384
)}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React from "react";
2+
3+
export default function AdjustmentsIcon() {
4+
return (
5+
<svg
6+
width="24"
7+
height="24"
8+
viewBox="0 0 24 24"
9+
strokeWidth="2"
10+
stroke="currentColor"
11+
fill="none"
12+
strokeLinecap="round"
13+
strokeLinejoin="round"
14+
>
15+
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
16+
<circle cx="14" cy="6" r="2" />
17+
<line x1="4" y1="6" x2="12" y2="6" />
18+
<line x1="16" y1="6" x2="20" y2="6" />
19+
<circle cx="8" cy="12" r="2" />
20+
<line x1="4" y1="12" x2="6" y2="12" />
21+
<line x1="10" y1="12" x2="20" y2="12" />
22+
<circle cx="17" cy="18" r="2" />
23+
<line x1="4" y1="18" x2="15" y2="18" />
24+
<line x1="19" y1="18" x2="20" y2="18" />
25+
</svg>
26+
);
27+
}

src/helpers/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const ActionTypes = Object.freeze({
1010
ADD_COLUMN_TO_RIGHT: 'add_column_to_right',
1111
DELETE_COLUMN: 'delete_column',
1212
ENABLE_RESET: 'enable_reset',
13+
SETTINGS_COLUMN: 'settings_column',
1314
});
1415

1516
/** Flavours of data types */

0 commit comments

Comments
 (0)