Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: summarize colors #1377

Merged
merged 4 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions components/BackToTop/BackToTopButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const BackToTopButton = () => {
return null
}

const buttonClasses = `focus:animate-button-press rounded-full border border-white bg-violet-600 p-4 text-white shadow-xl duration-300 transition-colors focus:ring group-hover:border-dashed group-hover:border-violet-400 group-hover:bg-white dark:drop-shadow-[5px_5px_8px_rgba(124,58,237,0.25)] dark:group-hover:bg-[#101623] md:border-violet-600 ${
const buttonClasses = `focus:animate-button-press rounded-full border border-light-primary bg-theme-secondary p-4 text-light-primary shadow-xl duration-300 transition-colors focus:ring group-hover:border-dashed group-hover:border-theme-primary group-hover:bg-light-primary dark:drop-shadow-[5px_5px_8px_rgba(124,58,237,0.25)] dark:group-hover:bg-[#101623] md:border-violet-600 ${
status === 'preEnter' || status === 'exiting'
? 'opacity-0 translate-y-3'
: ''
Expand All @@ -53,7 +53,7 @@ export const BackToTopButton = () => {
onClick={handleClick}
title="Back to top"
>
<FaArrowUp className="group-hover:text-violet-500" />
<FaArrowUp className="group-hover:text-theme-secondary" />
</button>
<span className="absolute left-1/2 top-1/2 -z-10 hidden -translate-x-1/2 -translate-y-1/2 rotate-0 text-2xl transition-all duration-100 ease-in-out group-hover:ml-8 group-hover:block group-hover:rotate-45">
👾
Expand Down
8 changes: 4 additions & 4 deletions components/Cards/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const Card: FC<CardProps> = ({ data }) => {
}, [])

return (
<article className="z-10 h-full w-full rounded-3xl border border-dashed border-violet-500 dark:border-violet-400 bg-gray-100 shadow-lg dark:bg-gray-900 dark:text-gray-300 dark:shadow-sm">
<article className="z-10 h-full w-full rounded-3xl border border-dashed border-theme-secondary dark:border-theme-primary bg-[rgba(255,255,255,0.3)] shadow-md dark:bg-dark dark:text-text-primary dark:shadow-sm">
<div className="card-body">
<header className="flex justify-between items-center">
<h2
className="cursor-default md:truncate ... text-xl text-violet-600 dark:text-violet-400"
className="cursor-default md:truncate ... text-xl text-theme-secondary dark:text-theme-primary"
title={name}
>
{name}
Expand All @@ -41,7 +41,7 @@ const Card: FC<CardProps> = ({ data }) => {
{description}
</div>
{isOverflow && (
<p className="text-sm underline text-violet-600 dark:text-violet-400 text-right hover:text-violet-400 dark:hover:text-violet-300">
<p className="text-sm underline text-theme-secondary dark:text-theme-primary text-right hover:text-theme-primary dark:hover:text-text-primary">
Read More
</p>
)}
Expand All @@ -53,7 +53,7 @@ const Card: FC<CardProps> = ({ data }) => {
target="_blank"
rel="noopener noreferrer"
className={
'mt-2 flex w-full items-center justify-center gap-2 rounded-2xl border border-dashed border-transparent bg-violet-600 px-6 py-2 text-center text-white duration-100 hover:border-violet-400 hover:bg-transparent hover:text-violet-500 dark:hover:text-violet-400'
'mt-2 flex w-full items-center justify-center gap-2 rounded-2xl border border-dashed border-transparent bg-theme-secondary px-6 py-2 text-center text-light-primary duration-100 hover:border-theme-primary hover:bg-transparent hover:text-theme-secondary dark:hover:text-theme-primary'
}
>
Visit site
Expand Down
4 changes: 2 additions & 2 deletions components/CopyToClipboard/CopyToClipboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export const CopyToClipboard = ({ url }: CopyToClipboardProps): JSX.Element => {
<div className="dropdown dropdown-left dropdown-hover">
<FaRegCopy
size={'1.3rem'}
className="text-violet-500 cursor-pointer"
className="text-theme-primary cursor-pointer"
title="Copy link"
onClick={(e) => handleCopy(e)}
/>
<p className="dropdown-content bg-violet-500 text-white text-sm rounded-lg p-1.5 cursor-default">
<p className="dropdown-content bg-theme-secondary text-white text-sm rounded-lg px-3 py-1 cursor-default">
{success ? 'Copied!' : 'Copy'}
</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ export const Footer: FC = () => {
const isDarkMode = resolvedTheme === 'dark'

const nameStyles = `underline ${
isDarkMode ? 'text-gray-200' : 'text-violet-700'
isDarkMode ? 'text-light-primary' : 'text-theme-secondary'
} `

return (
<footer className="z-10 mb-4 flex w-full items-baseline justify-center rounded-lg py-2 backdrop-blur-md sm:py-3">
<p className="leading-7 tracking-wide text-center text-black dark:text-violet-400">
<p className="leading-7 tracking-wide text-center text-black dark:text-theme-primary">
<span>&copy; {new Date().getFullYear()} LinksHub | </span>
Developed by{' '}
<Link
Expand Down
11 changes: 2 additions & 9 deletions components/ForkButton/GitHubForkButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export const GitHubForkButton: FC<{ repo: string }> = ({ repo }) => {
fetchForkCount()
}, [repo])

// Other Styles for Light Mode: [bg-violet-500 text-white] OR [text-black-500 border border-black]

return (
<Link
href={`https://github.com/${repo}/fork`}
Expand All @@ -30,13 +28,8 @@ export const GitHubForkButton: FC<{ repo: string }> = ({ repo }) => {
rel="noopener noreferrer"
aria-label={`Fork ${repo} on GitHub`}
>
<div
className={
`${`inline-flex items-center px-4 py-1 text-sm font-semibold bg-transparent text-violet-500 border
border-violet-500 border-transparent rounded-sm transition-colors shadow-md transition duration-300
ease-in-out hover:text-black hover:border-black dark:hover:text-gray-300 dark:hover:border-gray-300`
}`
}
<div
className="inline-flex items-center py-1 text-sm font-semibold bg-transparent text-theme-secondary rounded-sm transition-colors transition duration-300 ease-in-out hover:text-text-secondary transition duration-300 ease-in-out dark:hover:text-text-primary dark:text-theme-primary"
>
<FaCodeBranch className="mr-1" />
<span className="font-semibold">Fork</span>
Expand Down
13 changes: 8 additions & 5 deletions components/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { FC, useContext } from 'react'
import Link from 'next/link'
import { AiOutlineMenu } from 'react-icons/ai'
import Logo from 'components/logo'
import Logo from 'components/logo/logo'
import { GlobalContext } from 'context/GlobalContext'
import { ThemeToggler } from '../ThemeToggler/themeToggler'
import { TopBar } from '../TopBar/TopBar'
Expand All @@ -11,18 +11,21 @@ export const Header: FC = () => {
const { toggleNav } = useContext(GlobalContext)

return (
<header className="fixed top-0 left-0 z-30 row-start-1 row-end-2 flex h-[76px] w-screen items-center justify-between">
<div className="bg-base-200 h-full w-fit flex-none px-6 py-4 dark:bg-gray-900 lg:w-[290px]">
<header className="fixed top-0 left-0 z-30 row-start-1 row-end-2 flex h-[76px] w-screen items-center justify-between bg-light-primary dark:bg-dark">
<div className="bg-[rgba(255,255,255,0.3)] h-full w-fit flex-none px-6 py-4 dark:bg-dark lg:w-[290px]">
<Link href="/">
<Logo className="text-3xl" />
</Link>
</div>
<div className="bg-base-200 relative h-full grow px-8 dark:bg-gray-900 lg:bg-gray-100 lg:dark:bg-[#101623]">
<div className="bg-light-primary relative h-full grow px-8 dark:bg-dark lg:dark:bg-dark-primary">
<TopBar className="absolute left-8 hidden h-full md:flex" />
<div className="absolute right-8 flex h-full gap-4">
<SocialMediaIconsList className="hidden lg:flex" />
<ThemeToggler />
<button className="dark:text-gray-300 lg:hidden" onClick={toggleNav}>
<button
className="dark:text-text-primary lg:hidden"
onClick={toggleNav}
>
<AiOutlineMenu size={24} />
</button>
</div>
Expand Down
13 changes: 0 additions & 13 deletions components/MainContainer/MainContainer.tsx

This file was deleted.

1 change: 0 additions & 1 deletion components/MainContainer/index.ts

This file was deleted.

15 changes: 6 additions & 9 deletions components/NewIssue/NewIssue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ import Link from 'next/link'

const NewIssue: FC = () => {
return (
<p className="pt-6 md:p-0 coming-soon">
<span className="text-2xl">
Be the first to add by creating a GitHub issue
</span>{' '}
<span className="motion-safe:animate-pulse text-2xl text-purple-500">
<Link
<div className="pt-6 md:p-0 text-xl w-fit m-auto">
<span>Be the first to add by creating a GitHub issue </span>
<Link
className="dark:text-theme-primary text-theme-secondary underline"
href="https://github.com/rupali-codes/LinksHub/issues/new?assignees=&labels=add+link&template=add_link.yml&title=%5BAdd%5D+%3Cname%3E"
target="_blank"
>
<u>here</u>
here
</Link>
</span>
</p>
</div>
)
}

Expand Down
21 changes: 7 additions & 14 deletions components/Searchbar/Searchbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ interface SearchbarProps {
setSearch: (search: string) => void
}

// const subcategory =subcategoryArray;

// const subcategoryList: SubCategory[] = Object.keys(SubCategory).filter(
// (key) => isNaN(Number(key))
// ) as SubCategory[];

const searchOptions = subcategoryArray

export const Searchbar: React.FC<SearchbarProps> = ({ setSearch }) => {
const router = useRouter()
Expand All @@ -34,7 +27,7 @@ export const Searchbar: React.FC<SearchbarProps> = ({ setSearch }) => {
setSuggestions([])
setSearch('')
} else {
const filteredSuggestions = searchOptions.filter((option) =>
const filteredSuggestions = subcategoryArray.filter((option) =>
option.toLowerCase().includes(trimmedValue)
)
setSuggestions(filteredSuggestions)
Expand Down Expand Up @@ -80,31 +73,31 @@ export const Searchbar: React.FC<SearchbarProps> = ({ setSearch }) => {
<input
type="text"
id="simple-search"
className="block p-2.5 w-full bg-transparent text-sm text-gray-900 dark:text-gray-200 border border-dashed border-gray-400 dark:border-gray-500 focus:border-violet-500 dark:focus:border-violet-500 dark:focus:ring-violet-500 focus:ring-violet-500 dark:placeholder-gray-400 outline-none transition-all ease-in-out duration-300 rounded-lg"
placeholder="Start searching..."
className="block p-2.5 w-full bg-transparent text-sm text-dark dark:text-text-primary border border-dashed border-gray-text focus:border-theme-secondary dark:focus:border-theme-primary dark:focus:ring-theme-primary focus:ring-theme-secondary dark:placeholder-gray-text outline-none transition-all ease-in-out duration-300 rounded-lg capitalize"
placeholder="Quick search..."
value={searchQuery}
onChange={handleSearchChange}
required
/>
<button
type="submit"
className="ml-2 px-4 py-2.5 bg-violet-500 text-white rounded-md border border-dashed border-transparent hover:border-violet-400 hover:bg-transparent hover:text-violet-400 dark:hover:text-violet-400"
className="ml-2 px-4 py-2.5 bg-theme-secondary text-light-primary rounded-md border border-dashed border-transparent hover:border-theme-primary hover:bg-transparent hover:text-theme-primary dark:hover:text-theme-primary transition-colors transition duration-300 ease-in-out"
>
<SearchIcon className="w-5 h-5" />
</button>
</div>
{suggestions.length > 0 && (
<ul
ref={dropdownRef}
className="absolute z-10 bg-white dark:bg-gray-800 w-full py-2 mt-1 rounded-lg shadow-lg"
className="absolute z-10 text-light-primary bg-theme-secondary w-full mt-1 rounded-lg shadow-2xl"
>
{suggestions.map((suggestion) => (
<li
key={suggestion}
className="px-4 py-2 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700"
className="px-4 py-2 cursor-pointer hover:bg-[rgba(0,0,0,0.2)] capitalize"
onClick={() => handleSuggestionClick(suggestion)}
>
{suggestion}
{suggestion.split('-').join(' ')}
</li>
))}
</ul>
Expand Down
2 changes: 1 addition & 1 deletion components/SideNavbar/SideNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const SideNavbar: FC = () => {
>
<SideNavbarHeader />
<SocialMediaIconsList
className="bg-gray-100 px-6 py-2 dark:bg-gray-900"
className="bg-light-primary px-6 py-2 dark:bg-dark"
showGithubButtons={true} // to show the Star & Fork Button below social media icons
/>
<SideNavbarBody />
Expand Down
4 changes: 2 additions & 2 deletions components/SideNavbar/SideNavbarBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export const SideNavbarBody: FC = () => {
return (
<div
className={classNames(
`bg-base-200 h-full w-full overflow-x-hidden whitespace-nowrap transition-all ease-in dark:bg-gray-900 dark:text-gray-300`,
`bg-[rgba(255,255,255,0.3)] h-full w-full overflow-x-hidden whitespace-nowrap transition-all ease-in dark:bg-dark dark:text-text-primary`,
theme === 'light' ? 'scrollColorLight' : 'scrollColorDark'
)}
>
<div className="bg-base-200 transiton-all w-full p-4 transition-none ease-in dark:bg-gray-900">
<div className="bg-primary-light transiton-all w-full p-4 transition-none ease-in dark:bg-dark">
<Searchbar setSearch={setSearch} />
</div>
<SideNavbarCategoryList
Expand Down
4 changes: 2 additions & 2 deletions components/SideNavbar/SideNavbarCategory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const SideNavbarCategory: FC<{
))

return (
<li className="relative w-full transition-all ease-in-out text-violet-600 dark:text-violet-400 dark:bg-opacity-5 hover:text-violet-500 dark:hover:text-violet-300 rounded-md focus-visible:outline-none focus-visible:ring focus-visible:ring-violet-400">
<li className="relative w-full transition-all ease-in-out text-theme-secondary dark:text-theme-primary dark:bg-opacity-5 hover:text-theme-secondary dark:hover:text-theme-primary rounded-md focus-visible:outline-none focus-visible:ring focus-visible:ring-theme-primary">
<button
className="flex w-full cursor-pointer justify-between py-2"
onClick={handleToggle}
Expand All @@ -40,7 +40,7 @@ export const SideNavbarCategory: FC<{
isOpen ? 'max-h-screen' : ''
}`}
>
<ul className="relative ml-1 border-l-2 border-slate-300 dark:border-slate-700 -pl-0.5">
<ul className="relative ml-1 border-l-2 dark:border-zinc-500 border-zinc-300 -pl-0.5">
{subcategoryList}
</ul>
</div>
Expand Down
10 changes: 5 additions & 5 deletions components/SideNavbar/SideNavbarElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ export const SideNavbarElement = ({ name, url }: SubCategories) => {
onClick={closeNav}
className={`${
router.asPath === url
? 'border-l-4 border-violet-500 text-violet-700 dark:text-violet-400 '
: 'text-slate-600 dark:text-slate-400'
} collapse w-full text-start pl-3 hover:text-violet-500 dark:hover:text-violet-300
focus-visible:outline-none focus-visible:ring focus-visible:ring-violet-400 focus-visible:rounded-lg`}
? 'border-l-4 border-theme-primary text-theme-secondary dark:text-theme-primary '
: 'text-text-secondary dark:text-gray-text'
} collapse w-full text-start pl-3 hover:text-theme-secondary dark:hover:text-violet-300
focus-visible:outline-none focus-visible:ring focus-visible:ring-theme-primary focus-visible:rounded-lg`}
>
<div className="ml-2 text-lg py-2 capitalize transition-all duration-300 hover:pl-2 dark:border-violet-500">
<div className="ml-2 text-lg py-2 capitalize transition-all duration-300 hover:pl-2 dark:border-theme-secondary">
{name}
</div>
</Link>
Expand Down
2 changes: 1 addition & 1 deletion components/SideNavbar/SideNavbarHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Link from 'next/link'
import { useContext } from 'react'
import { AiOutlineClose } from 'react-icons/ai'
import { GlobalContext } from 'context/GlobalContext'
import Logo from '../logo'
import Logo from '../logo/logo'
import { IContext } from 'types'

export const SideNavbarHeader: FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion components/SkipLink/SkipLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const SkipLink: FC = () => (
<div className="z-40 flex absolute left-1/2 transform -translate-x-1/2">
<a
href="#main"
className="-translate-y-20 focus:transform-none mt-2 flex items-center justify-center gap-2 rounded-2xl border border-dashed border-transparent bg-violet-600 px-6 py-2 text-center text-white"
className="-translate-y-20 focus:transform-none mt-2 flex items-center justify-center gap-2 rounded-2xl border border-dashed border-transparent bg-theme-secondary px-6 py-2 text-center text-light-primary"
>
Skip to main content
</a>
Expand Down
14 changes: 7 additions & 7 deletions components/SocialMedia/SocialMediaIconsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const SocialMediaIconsList: FC<{
const { className, showGithubButtons } = props

return (
<ul className={`flex flex-wrap gap-6 ${className}`}>
<ul className={`flex flex-wrap gap-5 ${className}`}>
{!showGithubButtons && (
<>
<li className="pt-6 hidden md:block">
Expand All @@ -26,7 +26,7 @@ export const SocialMediaIconsList: FC<{
<li>
<a
title="Link to Discord server (External Link)"
className="dark:text-gray-300"
className="dark:text-light-primary text-text-secondary"
target="_blank"
rel="noopener noreferrer"
href="https://discord.com/invite/NvK67YnJX5"
Expand All @@ -35,14 +35,14 @@ export const SocialMediaIconsList: FC<{
<IconContext.Provider
value={{ className: 'shared-class', size: '24' }}
>
<FaDiscord className="hover:text-discord transition duration-300 ease-in-out" />
<FaDiscord className="hover:text-theme-primary transition duration-300 ease-in-out" />
</IconContext.Provider>
</a>
</li>
<li>
<a
title="Link to Github project (External Link)"
className="dark:text-gray-300"
className="dark:text-light-primary text-text-secondary"
target="_blank"
rel="noopener noreferrer"
href="https://github.com/rupali-codes/LinksHub"
Expand All @@ -51,14 +51,14 @@ export const SocialMediaIconsList: FC<{
<IconContext.Provider
value={{ className: 'shared-class', size: '24' }}
>
<FaGithub className="hover:text-github transition duration-300 ease-in-out" />
<FaGithub className="hover:text-theme-primary transition duration-300 ease-in-out" />
</IconContext.Provider>
</a>
</li>
<li>
<a
title="Link to Twitter page (External Link)"
className="dark:text-gray-300"
className="dark:text-light-primary text-text-secondary"
target="_blank"
rel="noopener noreferrer"
href="https://twitter.com/linkshubdotdev"
Expand All @@ -67,7 +67,7 @@ export const SocialMediaIconsList: FC<{
<IconContext.Provider
value={{ className: 'shared-class', size: '24' }}
>
<FaTwitter className="hover:text-twitter transition duration-300 ease-in-out" />
<FaTwitter className="hover:text-theme-primary transition duration-300 ease-in-out" />
</IconContext.Provider>
</a>
</li>
Expand Down
Loading