From d6e317a070125b6bca3ef28d62eb9cf2bc339b76 Mon Sep 17 00:00:00 2001 From: Nurfirliana Muzanella Date: Tue, 30 Jul 2024 14:25:06 +0700 Subject: [PATCH 1/7] add publish button --- hosting/src/components/Button.tsx | 10 +++++----- hosting/src/components/Header/index.tsx | 9 ++++++++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/hosting/src/components/Button.tsx b/hosting/src/components/Button.tsx index 40e73142..4c1e1c18 100644 --- a/hosting/src/components/Button.tsx +++ b/hosting/src/components/Button.tsx @@ -1,4 +1,4 @@ -import React, {useState} from "react"; +import React, { useState } from "react"; interface ButtonProps { title: string; @@ -36,16 +36,16 @@ export function Button({title, onClick, style = "normal", color = "primary", chi switch (color) { case "primary": - styles.push("bg-primary", "text-white"); + styles.push("bg-primary", !style ? "text-white" : ""); break; case "meta-3": - styles.push("bg-meta-3", "text-white"); + styles.push("bg-meta-3", !style ? "text-white" : ""); break; case "black": - styles.push("bg-black", "text-white"); + styles.push("bg-black", !style ? "text-white" : ""); break; default: - styles.push("bg-primary", "text-white"); + styles.push("bg-primary", !style ? "text-white" : ""); } switch (style) { diff --git a/hosting/src/components/Header/index.tsx b/hosting/src/components/Header/index.tsx index 37b5e5d6..4e77536b 100644 --- a/hosting/src/components/Header/index.tsx +++ b/hosting/src/components/Header/index.tsx @@ -1,6 +1,7 @@ +import { Button } from "@/components/Button"; import DarkModeSwitcher from "@/components/Header/DarkModeSwitcher"; import DropdownUser from "@/components/Header/DropdownUser"; -import {useAuthentication} from "@/hooks/useAuthentication"; +import { useAuthentication } from "@/hooks/useAuthentication"; import Image from "next/image"; import Link from "next/link"; @@ -9,6 +10,12 @@ const Header = (props: {sidebarOpen: string | boolean | undefined; setSidebarOpe return (
+