From 388e687857345c85ee550cd5da472675e05a6ff5 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Tue, 26 Sep 2023 18:43:11 +0200
Subject: refactor(components): rewrite Button and ButtonLink components

Both:
* move styles to Sass placeholders

Button:
* add `isPressed` prop to Button
* add `isLoading` prop to Button (to differentiate state from
disabled)

ButtonLink:
* replace `external` prop with `isExternal` prop
* replace `href` prop with `to` prop
---
 src/pages/index.tsx | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

(limited to 'src/pages/index.tsx')

diff --git a/src/pages/index.tsx b/src/pages/index.tsx
index 9cecfcf..816e44e 100644
--- a/src/pages/index.tsx
+++ b/src/pages/index.tsx
@@ -40,7 +40,7 @@ const CodingLinks: FC = () => {
     {
       id: 'web-development',
       value: (
-        <ButtonLink target={ROUTES.THEMATICS.WEB_DEV}>
+        <ButtonLink to={ROUTES.THEMATICS.WEB_DEV}>
           {intl.formatMessage({
             defaultMessage: 'Web development',
             description: 'HomePage: link to web development thematic',
@@ -52,7 +52,7 @@ const CodingLinks: FC = () => {
     {
       id: 'projects',
       value: (
-        <ButtonLink target={ROUTES.PROJECTS}>
+        <ButtonLink to={ROUTES.PROJECTS}>
           {intl.formatMessage({
             defaultMessage: 'Projects',
             description: 'HomePage: link to projects',
@@ -82,7 +82,7 @@ const ColdarkRepos: FC = () => {
     {
       id: 'coldark-github',
       value: (
-        <ButtonLink target={repo.github} external={true}>
+        <ButtonLink isExternal to={repo.github}>
           {intl.formatMessage({
             defaultMessage: 'Github',
             description: 'HomePage: Github link',
@@ -94,7 +94,7 @@ const ColdarkRepos: FC = () => {
     {
       id: 'coldark-gitlab',
       value: (
-        <ButtonLink target={repo.gitlab} external={true}>
+        <ButtonLink isExternal to={repo.gitlab}>
           {intl.formatMessage({
             defaultMessage: 'Gitlab',
             description: 'HomePage: Gitlab link',
@@ -120,7 +120,7 @@ const LibreLinks: FC = () => {
     {
       id: 'free',
       value: (
-        <ButtonLink target={ROUTES.THEMATICS.FREE}>
+        <ButtonLink to={ROUTES.THEMATICS.FREE}>
           {intl.formatMessage({
             defaultMessage: 'Free',
             description: 'HomePage: link to free thematic',
@@ -132,7 +132,7 @@ const LibreLinks: FC = () => {
     {
       id: 'linux',
       value: (
-        <ButtonLink target={ROUTES.THEMATICS.LINUX}>
+        <ButtonLink to={ROUTES.THEMATICS.LINUX}>
           {intl.formatMessage({
             defaultMessage: 'Linux',
             description: 'HomePage: link to Linux thematic',
@@ -159,7 +159,7 @@ const ShaarliLink: FC = () => {
     {
       id: 'shaarli',
       value: (
-        <ButtonLink target={shaarliUrl}>
+        <ButtonLink isExternal to={shaarliUrl}>
           {intl.formatMessage({
             defaultMessage: 'Shaarli',
             description: 'HomePage: link to Shaarli',
@@ -186,7 +186,7 @@ const MoreLinks: FC = () => {
     {
       id: 'contact-me',
       value: (
-        <ButtonLink target={ROUTES.CONTACT}>
+        <ButtonLink to={ROUTES.CONTACT}>
           <Envelop aria-hidden={true} className={styles.icon} />
           {intl.formatMessage({
             defaultMessage: 'Contact me',
@@ -199,7 +199,7 @@ const MoreLinks: FC = () => {
     {
       id: 'rss-feed',
       value: (
-        <ButtonLink target={ROUTES.RSS}>
+        <ButtonLink to={ROUTES.RSS}>
           <FeedIcon aria-hidden={true} className={feedIconClass} />
           {intl.formatMessage({
             defaultMessage: 'Subscribe',
-- 
cgit v1.2.3

