-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from birongliu/dev
Dev
- Loading branch information
Showing
10 changed files
with
57 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"use client"; | ||
import React, { useState } from "react"; | ||
import CloseIcon from "../navigation/icons/Close"; | ||
import Button from "./Button"; | ||
|
||
export default function AnnouncementBanner({ text }: { text: string }) { | ||
const [open, setOpen] = useState(true); | ||
|
||
function handleClick() { | ||
setOpen((prev) => !prev); | ||
} | ||
|
||
return ( | ||
<div | ||
className={`bg-lightBeige w-full z-30 py-3 flex shadow-md md:text-center items-center px-5 sticky top-0 ${ | ||
open ? "block" : "hidden" | ||
}`} | ||
> | ||
<div className="flex items-center flex-col flex-1"> | ||
<p className="font-poppins text-primary text-center font-semibold"> | ||
Public Announcement: {text} | ||
</p> | ||
<a rel="noopener noreferrer" href="https://github.com/birongliu/CISC-4900/issues"> | ||
Link: https://github.com/birongliu/CISC-4900/issues | ||
</a> | ||
</div> | ||
<Button onClick={handleClick} className="bg-transparent"> | ||
<CloseIcon className="w-6 h-6" /> | ||
</Button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
import { cn } from '@/app/utils/functions' | ||
import React, { ReactNode } from 'react' | ||
import React, { ButtonHTMLAttributes, ReactNode } from 'react' | ||
|
||
export default function Button({ children, className }: { children: ReactNode, className?: string }) { | ||
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> { | ||
children: ReactNode; | ||
className?: string; | ||
} | ||
|
||
export default function Button({ children, className, ...rest }: ButtonProps) { | ||
return ( | ||
<button className={cn('bg-darkMaroon rounded-xl p-3 text-button-primary', className)}>{children}</button> | ||
<button {...rest} className={cn('bg-darkMaroon rounded-xl p-3 text-button-primary', className)}>{children}</button> | ||
) | ||
} |