Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
feat: remove twitter button (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizstacio authored Dec 8, 2022
1 parent c706416 commit 7a3f70e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 34 deletions.
9 changes: 7 additions & 2 deletions .github/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ inputs:
rust-version:
description: 'Rust version'
default: 1.64.0
forc-version:
description: 'Forc version'
default: 0.26.0


runs:
using: "composite"
Expand All @@ -27,6 +31,7 @@ runs:

- uses: actions/checkout@v2
- name: Install Fuel toolchain
uses: FuelLabs/action-fuel-toolchain@v0.3.0
uses: FuelLabs/action-fuel-toolchain@master
with:
toolchain: latest
name: swayswap-toolchain
components: forc@${{ inputs.forc-version }}
1 change: 0 additions & 1 deletion .github/workflows/deploy-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ on:

env:
RUST_VERSION: 1.61.0
FORC_VERSION: 0.16.1
NODE_VERSION: 16
PNPM_VERSION: 7.0.0
COMPOSE_VERSION: 2.6.0
Expand Down
17 changes: 1 addition & 16 deletions packages/app/src/systems/Core/components/ActionsWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import { BsTwitter } from "react-icons/bs";
import { FaFaucet } from "react-icons/fa";

import { FaucetDialog, useFaucetDialog } from "~/systems/Faucet";
import { Button, Link } from "~/systems/UI";

const tweetText = `I'm using #SwaySwap, a blazingly fast DEX on the Fuel devnet @fuellabs_\nhttps://fuellabs.github.io/swayswap`;
const tweetLink = `https://twitter.com/intent/tweet?text=${encodeURIComponent(
tweetText
)}`;
import { Button } from "~/systems/UI";

export function ActionsWidget() {
const faucetDialog = useFaucetDialog();
Expand All @@ -23,15 +17,6 @@ export function ActionsWidget() {
<FaFaucet />
<span className="content">Faucet</span>
</Button>
<Link href={tweetLink} isExternal className="no-underline">
<Button
size="md"
className="actionsWidget--btn actionsWidget--shareBtn"
>
<BsTwitter />
<span className="content">Share</span>
</Button>
</Link>
<FaucetDialog />
</div>
);
Expand Down
25 changes: 10 additions & 15 deletions packages/app/src/systems/Faucet/hooks/__mocks__/useFaucet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@ import type { Wallet } from 'fuels';

import { fetchFaucet } from '../useFaucet';

import { sleep } from '~/systems/Core';

export async function faucet(wallet: Wallet, times = 2) {
const range = Array.from({ length: times });
await Promise.all(
range.map(async (n, idx) => {
await sleep(200 * idx);
const res = await fetchFaucet({
method: 'POST',
body: JSON.stringify({
address: wallet?.address.toAddress(),
captcha: '',
}),
});
return res;
})
);
await range.reduce(async (promise) => {
await promise;
return fetchFaucet({
method: 'POST',
body: JSON.stringify({
address: wallet?.address.toAddress(),
captcha: '',
}),
});
}, Promise.resolve());
}

0 comments on commit 7a3f70e

Please sign in to comment.