Skip to content

Commit

Permalink
Merge pull request #397 from PatrickRose/press-config-switch
Browse files Browse the repository at this point in the history
Add switch to disable the press in the sidebar
  • Loading branch information
PatrickRose committed Mar 2, 2024
2 parents be6afd3 + 10f0738 commit 7ddf0bd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
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

0 comments on commit 7ddf0bd

Please sign in to comment.