From 6d3c5064da3b749f191027d07ac0d4d3e0ba5605 Mon Sep 17 00:00:00 2001 From: Sam Chau Date: Wed, 18 Sep 2024 19:16:26 +0930 Subject: [PATCH] feat: improve aesthetics of branch buttons --- .../settings/git/modal/ViewBranches.jsx | 80 +++++++++++++------ 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/settings/git/modal/ViewBranches.jsx b/frontend/src/components/settings/git/modal/ViewBranches.jsx index 76a2922..dc8e50e 100644 --- a/frontend/src/components/settings/git/modal/ViewBranches.jsx +++ b/frontend/src/components/settings/git/modal/ViewBranches.jsx @@ -222,6 +222,13 @@ const SettingsBranchModal = ({ } }; + const buttonStyle = ` + p-2 relative transition-transform duration-200 ease-in-out + hover:scale-110 + `; + + const iconStyle = ``; + return ( (
  • handleCheckout(branch.name) } - className='p-3 text-blue-600 dark:text-blue-400 hover:bg-blue-200 dark:hover:bg-blue-800 rounded-full transition-colors' + className={`${buttonStyle} text-blue-600 dark:text-blue-400`} disabled={ loadingAction === `checkout-${branch.name}` @@ -295,15 +302,19 @@ const SettingsBranchModal = ({ {loadingAction === `checkout-${branch.name}` ? ( ) : confirmAction === `checkout-${branch.name}` ? ( - + ) : ( )} @@ -316,17 +327,20 @@ const SettingsBranchModal = ({ branch.name ) } - className='p-3 text-green-600 dark:text-green-400 hover:bg-green-200 dark:hover:bg-green-800 rounded-full transition-colors' + className={`${buttonStyle} text-green-600 dark:text-green-400`} disabled={ loadingAction === 'branchOff' }> {loadingAction === 'branchOff' ? ( ) : ( - + )} @@ -346,7 +360,7 @@ const SettingsBranchModal = ({ branch.name ) } - className='p-3 text-purple-600 dark:text-purple-400 hover:bg-purple-200 dark:hover:bg-purple-800 rounded-full transition-colors' + className={`${buttonStyle} text-purple-600 dark:text-purple-400`} disabled={ loadingAction === `push-${branch.name}` @@ -354,15 +368,23 @@ const SettingsBranchModal = ({ {loadingAction === `push-${branch.name}` ? ( ) : confirmAction === `push-${branch.name}` ? ( - + ) : ( )} @@ -386,7 +408,7 @@ const SettingsBranchModal = ({ branch.name ) } - className='p-3 text-red-600 dark:text-red-400 hover:bg-red-200 dark:hover:bg-red-800 rounded-full transition-colors' + className={`${buttonStyle} text-red-600 dark:text-red-400`} disabled={ loadingAction === `delete-${branch.name}` @@ -394,14 +416,24 @@ const SettingsBranchModal = ({ {loadingAction === `delete-${branch.name}` ? ( ) : confirmAction === `delete-${branch.name}` ? ( - + ) : ( - + )} @@ -414,8 +446,11 @@ const SettingsBranchModal = ({ branch.name ) } - className='p-3 text-gray-600 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-gray-700 rounded-full transition-colors'> - + className={`${buttonStyle} text-gray-600 dark:text-gray-400`}> + )} @@ -426,10 +461,7 @@ const SettingsBranchModal = ({ {branchOffMode && ( -
    -

    - Create New Branch -

    +
    + className='px-4 h-9 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors text-sm font-medium shadow-sm disabled:opacity-50'> {loadingAction === 'branchOff' ? 'Creating...' : 'Create'}