Skip to content

Commit

Permalink
increase max width in rules page, catch typos in variant prop
Browse files Browse the repository at this point in the history
  • Loading branch information
merowin committed Nov 22, 2024
1 parent 75d4456 commit cb0e21a
Showing 1 changed file with 21 additions and 12 deletions.
33 changes: 21 additions & 12 deletions packages/vue-client/src/views/RulesView.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
<script setup lang="ts">
import { getRulesDescription } from "@ogfcommunity/variants-shared";
import {
getRulesDescription,
getVariantList,
} from "@ogfcommunity/variants-shared";
import { computed } from "vue";
import VariantDemoView from "./VariantDemoView.vue";
const props = defineProps<{ variant: string }>();
const rulesDescription = computed(() => getRulesDescription(props.variant));
const variantExists = computed(() => getVariantList().includes(props.variant));
function toUpperCaseFirstLetter(string: string) {
if (string.length === 0) {
return "";
Expand All @@ -18,26 +23,30 @@ function toUpperCaseFirstLetter(string: string) {

<template>
<main>
<div class="grid-page-layout">
<div v-if="!variantExists">Sorry, variant not found.</div>
<div v-if="variantExists" class="grid-page-layout">
<div>
<h1>{{ toUpperCaseFirstLetter(props.variant) }} Variant Rules</h1>
<p v-if="!rulesDescription">Under Construction</p>
<div v-if="rulesDescription" v-html="rulesDescription"></div>
</div>
<div>
<div class="rules-page">
<h1>{{ toUpperCaseFirstLetter(props.variant) }} Variant Rules</h1>
<p v-if="!rulesDescription">Under Construction</p>
<div v-if="rulesDescription" v-html="rulesDescription"></div>
</div>
<div>
<h1>Demo</h1>
<VariantDemoView v-bind:variant="variant" />
</div>
<h1>Demo</h1>
<VariantDemoView v-bind:variant="variant" />
</div>
</div>
</main>
</template>

<style scoped>
.rules-page {
main {
font-family: "helvetica", "arial", "sans-serif";
}
.grid-page-layout {
max-width: none;
}
:deep(strong, h1, h2) {
font-weight: bold;
}
Expand Down

0 comments on commit cb0e21a

Please sign in to comment.