Skip to content

Commit

Permalink
Input display bug (#30)
Browse files Browse the repository at this point in the history
* Display correct message

* Add cloudflare pages deploy action

* Fix action

* Only run on merge
  • Loading branch information
Naught0 authored Jan 11, 2024
1 parent a9e8b17 commit 38b123c
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 12 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
name: Publish to Cloudflare Pages
defaults:
run:
working-directory: frontend
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18

- name: Add pnpm
run: yarn global add pnpm

- name: Install deps
run: pnpm install

- name: Vite build
run: pnpm build

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: a5854f55e71b087aa3a3bcdae74b2489
projectName: combinator
directory: "./dist"
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: master
wranglerVersion: "3"
36 changes: 24 additions & 12 deletions frontend/src/ComboContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,8 @@ export const ComboContainer: FC = () => {
};

const comboTabs = useMemo(() => {
if (!deckData || filteredCombos.length < 1)
return (
<h1 className="is-size-4">
💡 Pro Tip: Try adding some{" "}
<Hyperlink href="https://commanderspellbook.com/">combos</Hyperlink>{" "}
to your list
</h1>
);
const noCombos = !comboData?.length;
const noCombosFound = !noCombos && filteredCombos.length < 1;
return (
<div>
<div className="flex gap-6 flex-col">
Expand All @@ -86,12 +80,30 @@ export const ComboContainer: FC = () => {
</div>
</div>
{addCardTabExplanation}
{filteredCombos?.map((c) => (
<Combo key={c.id} deckData={deckData} combo={c} />
))}
{noCombos && (
<h1 className="text-2xl mt-6">
💡 Pro Tip: Try adding some{" "}
<Hyperlink href="https://commanderspellbook.com/">combos</Hyperlink>{" "}
to your list
</h1>
)}
{noCombosFound && (
<h1 className="text-2xl mt-6">❌ No combos matching search</h1>
)}
{deckData &&
filteredCombos?.map((c) => (
<Combo key={c.id} deckData={deckData} combo={c} />
))}
</div>
);
}, [addCardTabExplanation, filter, setFilter, filteredCombos, deckData]);
}, [
addCardTabExplanation,
comboData,
filter,
setFilter,
filteredCombos,
deckData,
]);

return (
<>
Expand Down

0 comments on commit 38b123c

Please sign in to comment.