More fixes
This commit is contained in:
parent
56d393fcc8
commit
0b544fc507
3 changed files with 4 additions and 3 deletions
|
@ -89,7 +89,7 @@ export default function Content({ src }: { src: string}) {
|
|||
json: "json",
|
||||
}
|
||||
const split = window.location.pathname.split('.');
|
||||
set_content(<Text language={split.length == 0 ? 'none' : languages[split[split.length - 1]]} text={data} />);
|
||||
set_content(<Text language={split.length == 0 ? 'none' : (languages[split[split.length - 1] as keyof typeof languages] ?? 'none')} text={data} />);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ export const group = style({
|
|||
lineHeight: '1.4em',
|
||||
whiteSpace: 'pre',
|
||||
tabSize: 4,
|
||||
overflowX: 'scroll',
|
||||
'@media': {
|
||||
'screen and (min-width: 768px)': {
|
||||
fontSize: '1.1em',
|
||||
|
|
|
@ -10,7 +10,7 @@ export default function Text({ language, text }: { language: string, text: strin
|
|||
const media_matcher = window.matchMedia('(prefers-color-scheme: light)');
|
||||
const [light_theme, set_light_theme] = useState(media_matcher.matches);
|
||||
|
||||
function check_light_theme(event) {
|
||||
function check_light_theme(event: MediaQueryListEvent) {
|
||||
if (light_theme != event.matches) {
|
||||
set_light_theme(!light_theme);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ export default function Text({ language, text }: { language: string, text: strin
|
|||
code={text}
|
||||
language={language}
|
||||
>
|
||||
{({ className, style, tokens, getLineProps, getTokenProps }) => (
|
||||
{({ tokens, getLineProps, getTokenProps }) => (
|
||||
<div>
|
||||
{tokens.map((line, i) => (
|
||||
<div key={i} {...getLineProps({ line })}>
|
||||
|
|
Loading…
Reference in a new issue