Add style constants to index.css file (#601)
Improves code verbosity and organization of Tailwind classes.
This commit is contained in:
commit
3fd22bbbf3
4 changed files with 19 additions and 15 deletions
|
|
@ -179,14 +179,6 @@ export const COLUMN_DIV_STYLE =
|
||||||
*/
|
*/
|
||||||
export const NAV_DISPLAY_STYLE =
|
export const NAV_DISPLAY_STYLE =
|
||||||
" w-full flex justify-between py-12 pb-2 px-6 ";
|
" w-full flex justify-between py-12 pb-2 px-6 ";
|
||||||
|
|
||||||
/**
|
|
||||||
* The base text for subtitle of code dialog
|
|
||||||
* @constant
|
|
||||||
*/
|
|
||||||
export const BUTTON_DIV_STYLE = " flex gap-2 ";
|
|
||||||
(" focus:ring-1 focus:ring-offset-1 focus:ring-ring focus:outline-none ");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Header text for user projects
|
* Header text for user projects
|
||||||
* @constant
|
* @constant
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,18 @@ The cursor: default; property value restores the browser's default cursor style
|
||||||
|
|
||||||
|
|
||||||
@layer components {
|
@layer components {
|
||||||
|
.extra-side-bar-save-disable {
|
||||||
|
@apply text-muted-foreground
|
||||||
|
}
|
||||||
|
.extra-side-bar-buttons {
|
||||||
|
@apply relative inline-flex w-full items-center justify-center rounded-md bg-background px-2 py-2 text-foreground shadow-sm ring-1 ring-inset ring-input transition-all duration-500 ease-in-out
|
||||||
|
}
|
||||||
|
.extra-side-bar-buttons:hover {
|
||||||
|
@apply hover:bg-muted
|
||||||
|
}
|
||||||
|
.button-div-style {
|
||||||
|
@apply gap-2 flex
|
||||||
|
}
|
||||||
.input-primary:focus{
|
.input-primary:focus{
|
||||||
@apply focus:placeholder-transparent focus:ring-ring focus:border-ring
|
@apply focus:placeholder-transparent focus:ring-ring focus:border-ring
|
||||||
}
|
}
|
||||||
|
|
@ -161,4 +173,5 @@ The cursor: default; property value restores the browser's default cursor style
|
||||||
.input-dialog{
|
.input-dialog{
|
||||||
@apply text-ring cursor-pointer bg-transparent
|
@apply text-ring cursor-pointer bg-transparent
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -63,7 +63,7 @@ export default function ExtraSidebar() {
|
||||||
<div className="mb-2 mt-2 flex w-full items-center justify-between gap-2 px-2">
|
<div className="mb-2 mt-2 flex w-full items-center justify-between gap-2 px-2">
|
||||||
<ShadTooltip content="Import" side="top">
|
<ShadTooltip content="Import" side="top">
|
||||||
<button
|
<button
|
||||||
className="relative inline-flex w-full items-center justify-center rounded-md bg-background px-2 py-2 text-foreground shadow-sm ring-1 ring-inset ring-input transition-all duration-500 ease-in-out hover:bg-muted"
|
className="extra-side-bar-buttons"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// openPopUp(<ImportModal />);
|
// openPopUp(<ImportModal />);
|
||||||
uploadFlow();
|
uploadFlow();
|
||||||
|
|
@ -76,7 +76,7 @@ export default function ExtraSidebar() {
|
||||||
<ShadTooltip content="Export" side="top">
|
<ShadTooltip content="Export" side="top">
|
||||||
<button
|
<button
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"relative inline-flex w-full items-center justify-center rounded-md bg-background px-2 py-2 text-foreground shadow-sm ring-1 ring-inset ring-input transition-all duration-500 ease-in-out hover:bg-muted"
|
"extra-side-bar-buttons"
|
||||||
)}
|
)}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
openPopUp(<ExportModal />);
|
openPopUp(<ExportModal />);
|
||||||
|
|
@ -88,7 +88,7 @@ export default function ExtraSidebar() {
|
||||||
<ShadTooltip content="Code" side="top">
|
<ShadTooltip content="Code" side="top">
|
||||||
<button
|
<button
|
||||||
className={classNames(
|
className={classNames(
|
||||||
"relative inline-flex w-full items-center justify-center rounded-md bg-background px-2 py-2 text-foreground shadow-sm ring-1 ring-inset ring-input transition-all duration-500 ease-in-out hover:bg-muted"
|
"extra-side-bar-buttons"
|
||||||
)}
|
)}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
openPopUp(<ApiModal flow={flows.find((f) => f.id === tabId)} />);
|
openPopUp(<ApiModal flow={flows.find((f) => f.id === tabId)} />);
|
||||||
|
|
@ -100,7 +100,7 @@ export default function ExtraSidebar() {
|
||||||
|
|
||||||
<ShadTooltip content="Save" side="top">
|
<ShadTooltip content="Save" side="top">
|
||||||
<button
|
<button
|
||||||
className="relative inline-flex w-full items-center justify-center rounded-md bg-background px-2 py-2 text-foreground shadow-sm ring-1 ring-inset ring-input transition-all duration-500 ease-in-out hover:bg-muted"
|
className="extra-side-bar-buttons"
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
saveFlow(flows.find((f) => f.id === tabId));
|
saveFlow(flows.find((f) => f.id === tabId));
|
||||||
setSuccessData({ title: "Changes saved successfully" });
|
setSuccessData({ title: "Changes saved successfully" });
|
||||||
|
|
@ -110,7 +110,7 @@ export default function ExtraSidebar() {
|
||||||
<Save
|
<Save
|
||||||
strokeWidth={1.5}
|
strokeWidth={1.5}
|
||||||
className={
|
className={
|
||||||
"h-5 w-5" + (isPending ? " " : " text-muted-foreground")
|
"h-5 w-5" + (isPending ? " " : " extra-side-bar-save-disable")
|
||||||
}
|
}
|
||||||
></Save>
|
></Save>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import { Button } from "../../components/ui/button";
|
||||||
import { Link, useNavigate } from "react-router-dom";
|
import { Link, useNavigate } from "react-router-dom";
|
||||||
import { CardComponent } from "../../components/cardComponent";
|
import { CardComponent } from "../../components/cardComponent";
|
||||||
import { USER_PROJECTS_HEADER } from "../../constants";
|
import { USER_PROJECTS_HEADER } from "../../constants";
|
||||||
import { BUTTON_DIV_STYLE } from "../../constants";
|
|
||||||
export default function HomePage() {
|
export default function HomePage() {
|
||||||
const { flows, setTabId, downloadFlows, uploadFlows, addFlow, removeFlow } =
|
const { flows, setTabId, downloadFlows, uploadFlows, addFlow, removeFlow } =
|
||||||
useContext(TabsContext);
|
useContext(TabsContext);
|
||||||
|
|
@ -20,7 +19,7 @@ export default function HomePage() {
|
||||||
<Home className="w-6" />
|
<Home className="w-6" />
|
||||||
{USER_PROJECTS_HEADER}
|
{USER_PROJECTS_HEADER}
|
||||||
</span>
|
</span>
|
||||||
<div className={`${BUTTON_DIV_STYLE}`}>
|
<div className="button-div-style">
|
||||||
<Button
|
<Button
|
||||||
variant="primary"
|
variant="primary"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue