Skip to content

Commit

Permalink
Fixed how Play page looks for anonymous users
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed Dec 31, 2024
1 parent 7f7f92c commit 701da11
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 31 deletions.
8 changes: 2 additions & 6 deletions src/views/Play/CustomGames.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function CustomGames(): JSX.Element {
const canvas: HTMLCanvasElement = React.useMemo(() => allocateCanvasOrError(), []);
const seekgraph = React.useRef<SeekGraph>();

const disable_challenge_buttons = useHaveActiveGameSearch();
const disable_challenge_buttons = useHaveActiveGameSearch() || user.anonymous;

const [seekGraphVisible, setSeekGraphVisible] = usePreference("show-seek-graph");

Expand Down Expand Up @@ -431,11 +431,7 @@ export function CustomGames(): JSX.Element {
>
<div>
<div className="CustomGames--toggle-container showing-custom-games">
<button
disabled={disable_challenge_buttons}
className="custom-games-toggle"
onClick={toggleCustomGames}
>
<button className="custom-games-toggle" onClick={toggleCustomGames}>
{_("Hide custom games")}
</button>
<button
Expand Down
31 changes: 16 additions & 15 deletions src/views/Play/QuickMatch.styl
Original file line number Diff line number Diff line change
Expand Up @@ -360,21 +360,6 @@
}
}

.anonymous-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 2rem;
margin-bottom: 2rem;
font-size: 1.3rem;

.Link {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
}

.ogs-react-select__control {
// min-height: 2rem;
// height: 2rem;
Expand Down Expand Up @@ -489,6 +474,22 @@
justify-content: space-between;
gap: 2rem;

.anonymous-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 2rem;
margin-bottom: 2rem;
font-size: 1.3rem;
width: 100%;

.Link {
margin-left: 0.5rem;
margin-right: 0.5rem;
}
}

.play-button {
// margin-top: 3rem;
width: 100%;
Expand Down
10 changes: 0 additions & 10 deletions src/views/Play/QuickMatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -990,16 +990,6 @@ export function QuickMatch(): JSX.Element {

<div className="PlayButton-container">
{/* Bot */}
{user.anonymous && (
<div className="anonymous-container">
{_("Please sign in to play")}
<div>
<Link to="/register#/play">{_("Register for Free")}</Link>
{" | "}
<Link to="/sign-in#/play">{_("Sign in")}</Link>
</div>
</div>
)}

{!automatch_search_active && !user.anonymous && (
<button
Expand Down

0 comments on commit 701da11

Please sign in to comment.