Skip to content

Commit

Permalink
Merge branch 'main' into 01-landing-page
Browse files Browse the repository at this point in the history
  • Loading branch information
karlavasquez8 committed Apr 16, 2024
2 parents 3adf4d6 + f9b8a70 commit 25f2b61
Show file tree
Hide file tree
Showing 13 changed files with 826 additions and 144 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build and Deploy to Droplet

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Build and deploy app on server
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DROPLET_IP }}
username: ${{ secrets.DROPLET_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /var/www/speedrunstark
git pull origin main
pm2 stop speedrunstark
yarn install
cd packages/nextjs
yarn build
pm2 restart speedrunstark
pm2 save
36 changes: 34 additions & 2 deletions packages/nextjs/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,50 @@ import React from "react";
import { HeartIcon } from "@heroicons/react/24/outline";
import { SwitchTheme } from "~~/components/SwitchTheme";
import { BuidlGuidlLogo } from "~~/components/assets/BuidlGuidlLogo";
import { useTargetNetwork } from "~~/hooks/scaffold-stark/useTargetNetwork";
import { useGlobalState } from "~~/services/store/store";
import { devnet } from "@starknet-react/chains";
import { CurrencyDollarIcon } from "@heroicons/react/16/solid";
import Link from "next/link";
import { MagnifyingGlassIcon } from "@radix-ui/react-icons";

/**
* Site footer
*/
export const Footer = () => {
const isLocalNetwork = false;
const nativeCurrencyPrice = useGlobalState(
(state) => state.nativeCurrencyPrice,
);
const { targetNetwork } = useTargetNetwork();
const isLocalNetwork = targetNetwork.id === devnet.id;

return (
<div className="min-h-0 py-5 px-1 lg:mb-0 bg-base-100">
<div>
<div className="fixed flex justify-between items-center w-full z-10 p-4 bottom-0 left-0 pointer-events-none">
<div className="flex flex-col md:flex-row gap-2 pointer-events-auto"></div>
<div className="flex flex-col md:flex-row gap-2 pointer-events-auto">
{nativeCurrencyPrice > 0 && (
<div>
<div className="btn btn-primary btn-sm font-normal gap-1 cursor-auto">
<CurrencyDollarIcon className="h-4 w-4" />
<span>{nativeCurrencyPrice}</span>
</div>
</div>
)}
{isLocalNetwork && (
<>
{/*<Faucet />*/}
<Link
href="/blockexplorer"
passHref
className="btn btn-primary btn-sm font-normal gap-1"
>
<MagnifyingGlassIcon className="h-4 w-4" />
<span>Block Explorer</span>
</Link>
</>
)}
</div>
<SwitchTheme
className={`pointer-events-auto ${
isLocalNetwork ? "self-end md:self-auto" : ""
Expand Down
18 changes: 4 additions & 14 deletions packages/nextjs/components/ScaffoldStarkAppWithProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ import { useTheme } from "next-themes";
import { Toaster } from "react-hot-toast";
import {
StarknetConfig,
publicProvider,
argent,
braavos,
useInjectedConnectors,
starkscan,
jsonRpcProvider,
starknetChainId,
} from "@starknet-react/core";
import { Header } from "~~/components/Header";
import { Footer } from "~~/components/Footer";
import { ProgressBar } from "~~/components/scaffold-stark/ProgressBar";
import { appChains } from "~~/services/web3/connectors";
import { BurnerConnector } from "~~/services/web3/stark-burner/BurnerConnector";
import scaffoldConfig from "~~/scaffold.config";
import provider from "~~/services/web3/provider";
import { useNativeCurrencyPrice } from "~~/hooks/scaffold-stark/useNativeCurrencyPrice";

const ScaffoldStarkApp = ({ children }: { children: React.ReactNode }) => {
useNativeCurrencyPrice();

return (
<>
<div className="flex flex-col min-h-screen">
Expand All @@ -42,16 +42,6 @@ export const ScaffoldStarkAppWithProviders = ({
const isDarkMode = resolvedTheme === "dark";
const [mounted, setMounted] = useState(false);

const provider =
scaffoldConfig.rpcProviderUrl == ""
? publicProvider()
: jsonRpcProvider({
rpc: () => ({
nodeUrl: scaffoldConfig.rpcProviderUrl,
chainId: starknetChainId(scaffoldConfig.targetNetworks[0].id),
}),
});

useEffect(() => {
setMounted(true);
}, []);
Expand Down
7 changes: 6 additions & 1 deletion packages/nextjs/components/scaffold-stark/Balance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ export const Balance = ({ address, className = "", usdMode }: BalanceProps) => {
{displayUsdMode ? (
<>
<span className="text-[0.8em] font-bold mr-1">$</span>
<span>{(formattedBalance * price).toFixed(2)}</span>
<span>
{(formattedBalance * price).toLocaleString("en-US", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})}
</span>
</>
) : (
<>
Expand Down
Loading

0 comments on commit 25f2b61

Please sign in to comment.