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

Add switch to disable the press in the sidebar #397

Merged
merged 2 commits into from Mar 2, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/admin/game/create/api/route.ts
Expand Up @@ -108,6 +108,7 @@ const GAME_TYPES: Record<
theme: "first-contact",
breakingNewsBanner: true,
components: ["Defcon"],
hidePressInSidebar: true,
},
components: [
{
Expand Down
6 changes: 3 additions & 3 deletions src/components/DefconStatuses.tsx
Expand Up @@ -95,7 +95,7 @@ export function CountryDefcon({ country, status }: CountryDefconProps) {
}

return (
<div className="flex mx-auto lg:mx-4 w-[320px] max-w-[100%]">
<div className="flex mx-auto lg:w-full w-[320px] max-w-full">
<div
className={`flex-1 flex items-center content-center justify-center text-2xl border-0 transition duration-500 rounded-l-full ${BACKGROUNDS[status].activeBackground}`}
>
Expand All @@ -121,15 +121,15 @@ function DisplayDefconStatus({ defcon }: DefconProps) {

return (
<div className="flex justify-center mx-1">
<div className="w-full w-max-[400px]">
<div className="w-full">
<h3 className="text-2xl mt-2 mb-6 uppercase text-center lg:w-1/2 mx-auto">
DEFCON Levels
</h3>
{Object.entries(states).map(([state, countries]) => {
return (
<div
key={state}
className="pt-8 w-full xl:w-4/4 grid grid-cols-1 lg:grid-cols-1 gap-4"
className="pt-8 px-4 w-full xl:w-4/4 grid grid-cols-1 lg:grid-cols-1 gap-4"
>
{countries.map((country, key) => {
return (
Expand Down
5 changes: 3 additions & 2 deletions src/components/SideComponents.tsx
Expand Up @@ -128,9 +128,10 @@ export default function SideComponentWrapper({
});

return (
<div className="hidden lg:flex flex-col justify-between border-l-4 border-turn-counter-past-light w-full lg:w-1/3 max-h-screen">
<div className="hidden lg:flex flex-col justify-between border-l-4 border-turn-counter-past-light w-full lg:w-1/3 xl:w-1/4 max-h-screen">
<div className="flex flex-1 flex-col overflow-auto">
{setupInformation.press === false ? (
{setupInformation.press === false ||
setupInformation.hidePressInSidebar ? (
<SideComponents components={toShow} />
) : toShow.length > 0 ? (
<SideComponentsWithPress
Expand Down
1 change: 1 addition & 0 deletions src/types/io-ts-def.ts
Expand Up @@ -200,6 +200,7 @@ export const SetupInformationDecode = t.intersection([
}),
t.partial({
press: t.union([t.literal(false), t.array(PressDecode), PressDecode]),
hidePressInSidebar: t.boolean,
}),
]);

Expand Down