Skip to content

Commit

Permalink
feat: new main popup buttons (#2939)
Browse files Browse the repository at this point in the history
* feat: new buttons for homescreen

* fix: remove obsolete surface colors

* fix: migrate to children instead of title

* fix: font color
  • Loading branch information
reneaaron authored Dec 18, 2023
1 parent a889455 commit 46f0a32
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 33 deletions.
72 changes: 43 additions & 29 deletions src/app/screens/Home/DefaultView/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
ArrowRightIcon,
ReceiveIcon,
SendIcon,
} from "@bitcoin-design/bitcoin-icons-react/filled";
import { ArrowRightIcon } from "@bitcoin-design/bitcoin-icons-react/filled";
import Button from "@components/Button";
import Loading from "@components/Loading";
import TransactionsTable from "@components/TransactionsTable";
Expand Down Expand Up @@ -108,40 +104,40 @@ const DefaultView: FC<Props> = (props) => {
toast.success(tCommon("actions.copied_to_clipboard"));
}}
>
{accountLoading && (
<>
⚡️&nbsp;
<SkeletonLoader className="w-32" />
</>
)}
{!accountLoading && (
<>
<span>⚡️ {lightningAddress}</span>
</>
<img src="assets/icons/popicons/bolt.svg" className="mr-1" />
{!accountLoading ? (
lightningAddress
) : (
<SkeletonLoader className="w-32" />
)}
</a>
</div>
)}
<div className="flex mb-4 space-x-4">
<Button
fullWidth
icon={<ReceiveIcon className="w-6 h-6" />}
label={tCommon("actions.receive")}
direction="column"
<div className="flex mb-4 space-x-3 justify-between">
<HomeButton
icon={<img src="assets/icons/popicons/receive.svg" />}
onClick={() => {
navigate("/receive");
}}
/>

<Button
fullWidth
icon={<SendIcon className="w-6 h-6" />}
label={tCommon("actions.send")}
direction="column"
>
{tCommon("actions.receive")}
</HomeButton>
<HomeButton
icon={<img src="assets/icons/popicons/send.svg" />}
onClick={() => {
navigate("/send");
}}
/>
>
{tCommon("actions.send")}
</HomeButton>
<HomeButton
icon={<img src="assets/icons/popicons/apps.svg" />}
onClick={() => {
window.open(`https://getalby.com/discover`, "_blank");
}}
>
{tCommon("apps")}
</HomeButton>
</div>

{isBlockedUrl && (
Expand Down Expand Up @@ -192,4 +188,22 @@ const DefaultView: FC<Props> = (props) => {
);
};

const HomeButton = ({
icon,
onClick,
children,
}: {
icon: React.ReactNode;
children: React.ReactNode;
onClick: () => void;
}) => (
<button
className="bg-white dark:bg-surface-01dp hover:bg-amber-50 dark:hover:bg-surface-02dp text-gray-800 dark:text-neutral-200 rounded-xl border border-gray-300 dark:border-neutral-800 hover:border-primary dark:hover:border-primary flex flex-col flex-1 justify-center items-center pt-[18px] pb-3 px-[14px] text-xs font-medium gap-2"
onClick={onClick}
>
{icon}
{children}
</button>
);

export default DefaultView;
1 change: 1 addition & 0 deletions src/i18n/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@
"balance": "Balance",
"or": "or",
"website": "Website",
"apps": "Apps",
"actions": {
"back": "Back",
"delete": "Delete",
Expand Down
1 change: 1 addition & 0 deletions static/assets/icons/popicons/apps.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions static/assets/icons/popicons/bolt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions static/assets/icons/popicons/receive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions static/assets/icons/popicons/send.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,9 @@ module.exports = {
"surface-00dp": surfaceColor,
"surface-01dp": lighten(surfaceColor, 5),
"surface-02dp": lighten(surfaceColor, 7),
"surface-03dp": lighten(surfaceColor, 8),
"surface-04dp": lighten(surfaceColor, 9),
"surface-06dp": lighten(surfaceColor, 11),
"surface-08dp": lighten(surfaceColor, 12),
"surface-12dp": lighten(surfaceColor, 14),
"surface-16dp": lighten(surfaceColor, 15),
"surface-24dp": lighten(surfaceColor, 16),
},
},
backgroundImage: (theme) => ({
Expand Down

0 comments on commit 46f0a32

Please sign in to comment.