Refactor and remove image alt warning

This commit is contained in:
Nilay Majorwar 2022-01-30 20:32:00 +05:30
parent 0a0be3dce2
commit 3889b97df5
3 changed files with 21 additions and 9 deletions

View File

@ -6,13 +6,7 @@ import Image from "next/image";
import { Card, Colors, Text } from "@blueprintjs/core";
import Link from "next/link";
import { useDarkMode } from "../ui/providers/dark-mode-provider";
const LANGUAGES = [
{ display: "Befunge-93", id: "befunge93" },
{ display: "Brainf*ck", id: "brainfuck" },
{ display: "Chef", id: "chef" },
{ display: "Deadfish", id: "deadfish" },
];
import LANGUAGES from "./languages.json";
const styles = {
rootContainer: {
@ -56,7 +50,7 @@ const Index: NextPage = () => {
<div style={{ ...styles.rootContainer, backgroundColor }}>
<div style={styles.headerContainer}>
<div style={{ flexGrow: 0, marginRight: 10 }}>
<Image src={logoImg} width={52} height={52} />
<Image src={logoImg} alt="logo" width={52} height={52} />
</div>
<Text tagName="div">
<h1>Esolang Park</h1>

18
pages/languages.json Normal file
View File

@ -0,0 +1,18 @@
[
{
"display": "Befunge-93",
"id": "befunge93"
},
{
"display": "Brainf*ck",
"id": "brainfuck"
},
{
"display": "Chef",
"id": "chef"
},
{
"display": "Deadfish",
"id": "deadfish"
}
]

View File

@ -11,7 +11,7 @@ export const Header = ({ langName }: { langName: string }) => {
<div style={{ flex: 1, textAlign: "left" }}>
<Button minimal large>
<div style={{ display: "flex", alignItems: "center" }}>
<Image src={logoImg} width={20} height={20} />
<Image src={logoImg} alt="logo" width={20} height={20} />
<span style={{ marginLeft: 10 }}>Esolang Park</span>
</div>
</Button>