Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/ImageSelect/ImageSelect.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
cursor: pointer;
min-height: 2.5rem;
transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
margin-bottom: 0;
margin-bottom: var(--spacing);
}

.selectTrigger:hover {
Expand Down
7 changes: 0 additions & 7 deletions src/routes/game/create/CreateGame.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
}
}

.title {
margin: 0 0 0.25rem;
font-size: 1.1rem;
font-weight: 700;
color: var(--theme-text, #ededed);
}

.fieldError {
color: red;
}
Expand Down
3 changes: 1 addition & 2 deletions src/routes/game/create/CreateGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ const CreateGame = () => {
return (
<div>
<article className={styles.formContainer}>
<h3 className={styles.title}>Create New Game</h3>
<h3>Create New Game</h3>
{/*<p className={styles.fieldError}>
<FaExclamationCircle /> Warning - SOON! an update will be pushed to the live servers. The games in progress will crash and new games will be required.
</p> */}
Expand Down Expand Up @@ -450,7 +450,6 @@ const CreateGame = () => {
type="text"
id="fabdb"
aria-label="Deck Link - URL from FaBrary.net"
placeholder="https://fabrary.net/decks/…"
{...register('fabdb')}
aria-invalid={errors.deck?.message ? 'true' : undefined}
/>
Expand Down
29 changes: 12 additions & 17 deletions src/routes/index/Index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import News from 'routes/news';
import DevTool from './components/devTool';
import AboutSection from './components/AboutSection';
import CommunityContent from './components/CommunityContent';
import { QuickJoinProvider } from './components/quickJoin/QuickJoinContext';
import QuickJoinPanel from './components/quickJoin/QuickJoinPanel';

const Index = () => {
usePageTitle('Home');
Expand All @@ -28,22 +26,19 @@ const Index = () => {

return (
<main>
<QuickJoinProvider>
<div className={styles.grid}>
{import.meta.env.DEV && <DevTool />}
<div className={styles.gameListContainer}>
<GameList />
</div>
<div className={styles.createGameContainer}>
<QuickJoinPanel />
<CreateGame />
</div>
<article className={styles.newsContainer}>
<img src={TalisharLogo} className={styles.logo} />
<News />
</article>
<div className={styles.grid}>
{import.meta.env.DEV && <DevTool />}
<div className={styles.gameListContainer}>
<GameList />
</div>
</QuickJoinProvider>
<div className={styles.createGameContainer}>
<CreateGame />
</div>
<article className={styles.newsContainer}>
<img src={TalisharLogo} className={styles.logo} />
<News />
</article>
</div>
<CommunityContent />
<AboutSection />
</main>
Expand Down
27 changes: 8 additions & 19 deletions src/routes/index/components/openGame/OpenGame.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React, { useContext } from 'react';
import classNames from 'classnames';
import { useNavigate } from 'react-router-dom';
import { IOpenGame } from '../gameList/GameList';
import styles from './OpenGame.module.css';
import { generateCroppedImageUrl } from '../../../../utils/cropImages';
import FriendBadge from '../gameList/FriendBadge';
import QuickJoinContext from '../quickJoin/QuickJoinContext';

const OpenGame = ({
ix,
Expand All @@ -19,27 +17,16 @@ const OpenGame = ({
isFriendsGame?: boolean;
}) => {
const navigate = useNavigate();
const quickJoinCtx = useContext(QuickJoinContext);

const hasDeckReady = !!(quickJoinCtx?.hasDeckConfigured);

const handleJoin = (e: React.MouseEvent) => {
e.preventDefault();
e.stopPropagation();
if (hasDeckReady && quickJoinCtx) {
quickJoinCtx.quickJoin(entry.gameName);
} else {
navigate(`/game/join/${entry.gameName}`);
}
};

const buttonClass = classNames(styles.button, 'secondary');

return (
<div
key={ix}
className={styles.gameItem}
onClick={handleJoin}
onClick={(e) => {
e.preventDefault();
navigate(`/game/join/${entry.gameName}`);
}}
>
<div>
{!!entry.p1Hero ? (
Expand All @@ -56,8 +43,10 @@ const OpenGame = ({
className={buttonClass}
href={`/game/join/${entry.gameName}`}
role="button"
onClick={handleJoin}
title={hasDeckReady ? 'Join using your pre-configured deck' : 'Select a deck to join'}
onClick={(e) => {
e.preventDefault();
navigate(`/game/join/${entry.gameName}`);
}}
>
Join
</a>
Expand Down
185 changes: 0 additions & 185 deletions src/routes/index/components/quickJoin/QuickJoinContext.tsx

This file was deleted.

Loading