diff --git a/src/pages/Rules.module.css b/src/pages/Rules.module.css index e78bdc0..b6463cd 100644 --- a/src/pages/Rules.module.css +++ b/src/pages/Rules.module.css @@ -20,9 +20,28 @@ margin: 0 0 0.35rem; } -.section p { +.points { color: var(--color-charcoal); margin: 0; + padding: 0; + list-style: none; +} + +.points li { + position: relative; + padding-left: 1rem; + margin-bottom: 0.35rem; +} + +.points li:last-child { + margin-bottom: 0; +} + +.points li::before { + content: '\2013'; + position: absolute; + left: 0; + color: var(--color-gold); } .cta { diff --git a/src/pages/Rules.tsx b/src/pages/Rules.tsx index 152aa09..9fd31db 100644 --- a/src/pages/Rules.tsx +++ b/src/pages/Rules.tsx @@ -5,6 +5,13 @@ import RuleIcon from '../components/RuleIcon' import { fetchRules, type RuleSection } from '../data/rules' import styles from './Rules.module.css' +function splitIntoPoints(body: string): string[] { + return body + .split(/(?<=[.!?])\s+/) + .map((sentence) => sentence.trim()) + .filter(Boolean) +} + function Rules() { const [rules, setRules] = useState([]) const [error, setError] = useState('') @@ -31,7 +38,11 @@ function Rules() {

{rule.title}

-

{rule.body}

+
    + {splitIntoPoints(rule.body).map((point, pointIndex) => ( +
  • {point}
  • + ))} +