Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put seek graph alongside create game on desktop screens #2868

Closed
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
26 changes: 24 additions & 2 deletions src/views/Play/CustomGames.styl
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,43 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#CustomGames {
display: flex;
flex-direction: column;
align-items: stretch;
justify-content: center;
box-sizing: border-box;

.top-stuff {
display: flex;
flex-direction: column;

@media screen and (min-width: 850px){
// On deskop, put the seek graph next to the CreateGame form
flex-direction: row;
width: max-content; // Causes seek graph to be as wide as possible

.Card {
flex: 1;
}
}
.seek-graph{
flex: 1;
display: flex;
flex-direction: column;
}
}

.Modal {
border: none;
box-shadow: none;
}

.ChallengeModal {
width: 100%;
max-height: unset;
}


}
148 changes: 77 additions & 71 deletions src/views/Play/CustomGames.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -397,86 +397,92 @@ export function CustomGames(): JSX.Element {
}}
>
<div id="CustomGames">
<Card>
{liveOwnChallengePending() ? (
<>
<div className="automatch-header">{_("Waiting for opponent...")}</div>
<div className="automatch-row-container">
<div className="spinner">
<div className="double-bounce1"></div>
<div className="double-bounce2"></div>
<div className="top-stuff">
<Card>
{liveOwnChallengePending() ? (
<>
<div className="automatch-header">
{_("Waiting for opponent...")}
</div>
</div>
<div className="automatch-settings">
<button className="danger sm" onClick={cancelOwnChallenges}>
{pgettext("Cancel challenge", "Cancel")}
</button>
</div>
</>
) : live_rengo_challenge_to_show ? (
<>
<RengoManagementPane
challenge_id={live_rengo_challenge_to_show.challenge_id}
rengo_challenge_list={rengo_list}
startRengoChallenge={rengo_utils.startOwnRengoChallenge}
cancelChallenge={cancelOpenRengoChallenge}
withdrawFromRengoChallenge={unNominateForRengoChallenge}
joinRengoChallenge={rengo_utils.nominateForRengoChallenge}
lock={
rengo_manage_pane_lock[
live_rengo_challenge_to_show?.challenge_id
]
}
>
<RengoTeamManagementPane
<div className="automatch-row-container">
<div className="spinner">
<div className="double-bounce1"></div>
<div className="double-bounce2"></div>
</div>
</div>
<div className="automatch-settings">
<button className="danger sm" onClick={cancelOwnChallenges}>
{pgettext("Cancel challenge", "Cancel")}
</button>
</div>
</>
) : live_rengo_challenge_to_show ? (
<>
<RengoManagementPane
challenge_id={live_rengo_challenge_to_show.challenge_id}
challenge_list={rengo_list}
moderator={user.is_moderator}
show_chat={false}
assignToTeam={rengo_utils.assignToTeam}
kickRengoUser={rengo_utils.kickRengoUser}
locked={
rengo_challenge_list={rengo_list}
startRengoChallenge={rengo_utils.startOwnRengoChallenge}
cancelChallenge={cancelOpenRengoChallenge}
withdrawFromRengoChallenge={unNominateForRengoChallenge}
joinRengoChallenge={rengo_utils.nominateForRengoChallenge}
lock={
rengo_manage_pane_lock[
live_rengo_challenge_to_show.challenge_id
live_rengo_challenge_to_show?.challenge_id
]
}
lock={(lock: boolean) =>
setPaneLock(live_rengo_challenge_to_show.challenge_id, lock)
}
>
<RengoTeamManagementPane
challenge_id={live_rengo_challenge_to_show.challenge_id}
challenge_list={rengo_list}
moderator={user.is_moderator}
show_chat={false}
assignToTeam={rengo_utils.assignToTeam}
kickRengoUser={rengo_utils.kickRengoUser}
locked={
rengo_manage_pane_lock[
live_rengo_challenge_to_show.challenge_id
]
}
lock={(lock: boolean) =>
setPaneLock(
live_rengo_challenge_to_show.challenge_id,
lock,
)
}
/>
</RengoManagementPane>
</>
) : (
<div>
<ChallengeModalBody
mode="open"
modal={{
on: (event: "open" | "close", callback: () => void) => {
console.log("on", event, callback);
},
off: (event: "open" | "close", callback: () => void) => {
console.log("off", event, callback);
},
}}
/>
</RengoManagementPane>
</>
) : (
<div>
<ChallengeModalBody
mode="open"
modal={{
on: (event: "open" | "close", callback: () => void) => {
console.log("on", event, callback);
},
off: (event: "open" | "close", callback: () => void) => {
console.log("off", event, callback);
},
}}
/>
</div>
)}
</Card>
<div className="seek-graph">
<h2>{pgettext("Games available to accept", "Available Games")}</h2>

<div ref={ref_container} className="seek-graph-container">
<OgsResizeDetector onResize={onResize} targetRef={ref_container} />
<PersistentElement elt={canvas} />
</div>
)}
</Card>
<div className="row">
<h2>{pgettext("Games available to accept", "Available Games")}</h2>

<div ref={ref_container} className="seek-graph-container">
<OgsResizeDetector onResize={onResize} targetRef={ref_container} />
<PersistentElement elt={canvas} />
</div>

<SeekGraphLegend
filter={filter}
showIcons={true}
toggleHandler={toggleFilterHandler}
></SeekGraphLegend>
<SeekGraphLegend
filter={filter}
showIcons={true}
toggleHandler={toggleFilterHandler}
></SeekGraphLegend>
</div>
</div>

<div id="challenge-list-container">
<div id="challenge-list-inner-container">
<div id="challenge-list" onMouseMove={freezeChallenges}>
Expand Down
Loading