Skip to content

Commit

Permalink
Refactor button styles and spacing in contact and home pages
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorKowalczyk committed Sep 25, 2024
1 parent 6318daf commit 9b0e9c6
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/contact/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function Page() {
<Description>Or contact me with...</Description>
<div className="mt-4 flex flex-wrap gap-4">
{contact.links.map((element) => (
<ButtonTertiary href={element.href} key={`contact-link-${element.href}`} target="_blank" className="mt-0 gap-2">
<ButtonTertiary href={element.href} key={`contact-link-${element.href}`} target="_blank" className="gap-2">
{element.icon} {element.title}
</ButtonTertiary>
))}
Expand Down
8 changes: 4 additions & 4 deletions app/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export default async function HomePage() {
<section className="mb-16 mt-20">
<h1 className="dark:color-black relative m-0 text-4xl font-black tracking-[-0.03em] text-gray-800 duration-300 dark:text-white md:text-left">Hey, I’m {header.title}</h1>
<p className="mt-2 text-lg text-gray-700 dark:text-neutral-400">{header.description}</p>
<div className="mt-4 flex flex-row gap-5">
<ButtonPrimary href="/#contact" className="mt-4 md:mt-6">
<div className="mt-9 flex flex-row flex-wrap gap-5">
<ButtonPrimary href="/#contact">

Check failure on line 27 in app/page.jsx

View workflow job for this annotation

GitHub Actions / ESLint (lts/*)

Replace `⏎······Contact·me⏎·····` with `Contact·me`

Check failure on line 27 in app/page.jsx

View workflow job for this annotation

GitHub Actions / ESLint (lts/*)

Replace `⏎······Contact·me⏎·····` with `Contact·me`
Contact me
</ButtonPrimary>
<ButtonSecondary href="/#about" className="mt-4 md:mt-6">
<ButtonSecondary href="/#about">

Check failure on line 30 in app/page.jsx

View workflow job for this annotation

GitHub Actions / ESLint (lts/*)

Replace `⏎······More·about·me⏎·····` with `More·about·me`

Check failure on line 30 in app/page.jsx

View workflow job for this annotation

GitHub Actions / ESLint (lts/*)

Replace `⏎······More·about·me⏎·····` with `More·about·me`
More about me
</ButtonSecondary>
</div>
Expand Down Expand Up @@ -105,7 +105,7 @@ export default async function HomePage() {
<Description>Or contact me with...</Description>
<div className="mt-4 flex flex-wrap gap-4">
{contact.links.map((element) => (
<ButtonTertiary href={element.href} key={`contact-link-${element.href}`} target="_blank" className="mt-0 gap-2">
<ButtonTertiary href={element.href} key={`contact-link-${element.href}`} target="_blank" className="gap-2">
{element.icon} {element.title}
</ButtonTertiary>
))}
Expand Down
12 changes: 6 additions & 6 deletions components/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { cn } from "@/lib/utils";
export function ButtonPrimary({ href, children, icon = true, ...props }) {
if (href) {
return (
<Link href={href} {...props} className={cn("group mt-2 flex w-fit items-center rounded-md bg-blue-500 px-4 py-2 font-medium text-white duration-200 hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", props.className)}>
<Link href={href} {...props} className={cn("group flex w-fit items-center rounded-md bg-blue-500 px-4 py-2 font-medium text-white duration-200 hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", props.className)}>
{children}
{icon && (
<svg className="ml-2 size-4 duration-200 group-hover:translate-x-1 motion-reduce:transition-none motion-reduce:group-hover:translate-x-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
Expand All @@ -15,7 +15,7 @@ export function ButtonPrimary({ href, children, icon = true, ...props }) {
);
}
return (
<button {...props} className={cn("group mt-2 flex w-fit items-center rounded-md bg-blue-500 px-4 py-2 font-medium text-white duration-200 hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", props.className)} type="button">
<button {...props} className={cn("group flex w-fit items-center rounded-md bg-blue-500 px-4 py-2 font-medium text-white duration-200 hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", props.className)} type="button">
{children}
{icon && (
<svg className="ml-2 size-4 duration-200 group-hover:translate-x-1 motion-reduce:transition-none motion-reduce:group-hover:translate-x-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
Expand All @@ -29,7 +29,7 @@ export function ButtonPrimary({ href, children, icon = true, ...props }) {
export function ButtonSecondary({ href, children, icon = true, ...props }) {
if (href) {
return (
<Link href={href} {...props} className={cn("group mt-2 flex w-fit items-center rounded-md bg-gray-200 px-4 py-2 font-medium text-blue-900 duration-200 hover:bg-gray-300 motion-reduce:transition-none dark:bg-white/10 dark:text-white dark:hover:bg-white/15", props.className)}>
<Link href={href} {...props} className={cn("group flex w-fit items-center rounded-md bg-gray-200 px-4 py-2 font-medium text-blue-900 duration-200 hover:bg-gray-300 motion-reduce:transition-none dark:bg-white/10 dark:text-white dark:hover:bg-white/15", props.className)}>
{children}
{icon && (
<svg className="ml-2 size-4 duration-200 group-hover:translate-x-1 motion-reduce:transition-none motion-reduce:group-hover:translate-x-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
Expand All @@ -40,7 +40,7 @@ export function ButtonSecondary({ href, children, icon = true, ...props }) {
);
} else {
return (
<button {...props} className={cn("group mt-2 flex w-fit items-center rounded-md bg-gray-200 px-4 py-2 font-medium text-blue-900 duration-200 hover:bg-gray-300 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none dark:bg-white/10 dark:text-white dark:hover:bg-white/15", props.className)} type="button">
<button {...props} className={cn("group flex w-fit items-center rounded-md bg-gray-200 px-4 py-2 font-medium text-blue-900 duration-200 hover:bg-gray-300 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none dark:bg-white/10 dark:text-white dark:hover:bg-white/15", props.className)} type="button">
{children}
{icon && (
<svg className="ml-2 size-4 duration-200 group-hover:translate-x-1 motion-reduce:transition-none motion-reduce:group-hover:translate-x-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
Expand All @@ -55,7 +55,7 @@ export function ButtonSecondary({ href, children, icon = true, ...props }) {
export function ButtonTertiary({ href, children, icon = true, ...props }) {
if (href) {
return (
<Link href={href} {...props} className={cn("group mt-2 flex w-fit items-center rounded-md border bg-[#f8f9fa] px-4 py-2 font-medium text-blue-900 duration-200 hover:bg-[#f2f3f5] motion-reduce:transition-none dark:border-neutral-800 dark:bg-[#161617] dark:text-white dark:hover:border-neutral-700 dark:hover:bg-[#202021]", props.className)}>
<Link href={href} {...props} className={cn("group flex w-fit items-center rounded-md border bg-[#f8f9fa] px-4 py-2 font-medium text-blue-900 duration-200 hover:bg-[#f2f3f5] motion-reduce:transition-none dark:border-neutral-800 dark:bg-[#161617] dark:text-white dark:hover:border-neutral-700 dark:hover:bg-[#202021]", props.className)}>
{children}
{icon && (
<svg className="ml-2 size-4 duration-200 group-hover:translate-x-1 motion-reduce:transition-none motion-reduce:group-hover:translate-x-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
Expand All @@ -66,7 +66,7 @@ export function ButtonTertiary({ href, children, icon = true, ...props }) {
);
}
return (
<button {...props} className={cn("group mt-2 flex w-fit items-center rounded-md border bg-[#f8f9fa] px-4 py-2 font-medium text-blue-900 duration-200 hover:bg-[#f2f3f5] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none dark:border-neutral-800 dark:bg-[#161617] dark:text-white dark:hover:border-neutral-700 dark:hover:bg-[#202021]", props.className)} type="button">
<button {...props} className={cn("group flex w-fit items-center rounded-md border bg-[#f8f9fa] px-4 py-2 font-medium text-blue-900 duration-200 hover:bg-[#f2f3f5] disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none dark:border-neutral-800 dark:bg-[#161617] dark:text-white dark:hover:border-neutral-700 dark:hover:bg-[#202021]", props.className)} type="button">
{children}
{icon && (
<svg className="ml-2 size-4 duration-200 group-hover:translate-x-1 motion-reduce:transition-none motion-reduce:group-hover:translate-x-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={2}>
Expand Down
6 changes: 3 additions & 3 deletions components/ProjectCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ export function ProjectCard({ project }) {
</div>
))}
</div>
<div className="mt-4 flex flex-wrap gap-5">
<div className="mt-6 flex flex-wrap gap-5">
{project.website && (
<ButtonPrimary href={project.website} className="mt-4" target="_blank" rel="noopener noreferrer">
<ButtonPrimary href={project.website} target="_blank" rel="noopener noreferrer">
Visit website
</ButtonPrimary>
)}
{project.github && (
<ButtonSecondary href={project.github} className="mt-4" target="_blank" rel="noopener noreferrer">
<ButtonSecondary href={project.github} target="_blank" rel="noopener noreferrer">
View on Github
</ButtonSecondary>
)}
Expand Down
4 changes: 2 additions & 2 deletions components/client/MobileNav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function MobileNav() {

return (
<>
<ButtonSecondary className="!mt-0 size-10 justify-center border-0 lg:hidden" icon={false} onClick={() => setIsMenuOpen(true)}>
<ButtonSecondary className="size-10 justify-center border-0 lg:hidden" icon={false} onClick={() => setIsMenuOpen(true)}>
<Icons.AlignLeft className="size-5 shrink-0 text-gray-900 dark:text-gray-100" />
</ButtonSecondary>

Expand All @@ -49,7 +49,7 @@ export default function MobileNav() {
"dark:shadow-2x fixed left-0 top-0 z-50 flex h-screen w-full max-w-96 flex-col border-r border-black/10 bg-white/70 p-6 backdrop-blur-xl duration-200 motion-reduce:transition-none dark:border-neutral-800 dark:bg-[#161617]/70 lg:hidden"
)}
>
<ButtonSecondary className="ml-auto mr-0 mt-0 size-10 justify-center border-0" icon={false} onClick={() => setIsMenuOpen(false)}>
<ButtonSecondary className="ml-auto mr-0 size-10 justify-center border-0" icon={false} onClick={() => setIsMenuOpen(false)}>
<Icons.X className="size-5 shrink-0 text-gray-900 dark:text-gray-100" />
</ButtonSecondary>

Expand Down
4 changes: 2 additions & 2 deletions components/client/Settings.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function Settings() {
"bg-blue-200 dark:bg-white/15": isOpen,
"bg-gray-200 dark:bg-white/10": !isOpen,
},
"group !mt-0 ml-auto flex h-10 w-10 items-center justify-center px-2"
"group ml-auto flex h-10 w-10 items-center justify-center px-2"
)}
>
<Cog8ToothIcon
Expand Down Expand Up @@ -153,7 +153,7 @@ export default function Settings() {
Source code <ArrowTopRightOnSquareIcon className="ml-2 size-4 opacity-50 duration-100 group-hover:opacity-90 motion-reduce:transition-none" />
</Link>

<ButtonSecondary className="ml-auto mt-0" onClick={() => setIsOpen(false)}>
<ButtonSecondary className="ml-auto" onClick={() => setIsOpen(false)}>
Close
</ButtonSecondary>
</div>
Expand Down

0 comments on commit 9b0e9c6

Please sign in to comment.