Skip to content

Commit

Permalink
Got rid of viteConfig.base
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisMGeo committed Aug 18, 2024
1 parent db0f492 commit e237184
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions src/components/char-select-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Element } from "../consts";
import ThumbSide from "./thumb-side";
import { useNavigate } from "react-router-dom";
import { translatedCharacterInfo } from "../consts/character-info";
const viteConfig = {base: "/genshin-helper-website"};

interface CharSelectDropdownProps {
characterKey: string;
Expand Down Expand Up @@ -48,7 +47,7 @@ const CharSelectDropdown = ({
aria-expanded={open ? "true" : "false"}
startIcon={
<ThumbSide
src={`${viteConfig.base}/characters/${characterKey}/side-icon.png`}
src={`/genshin-helper-website/characters/${characterKey}/side-icon.png`}
alt={characterName}
/>
}
Expand Down
9 changes: 4 additions & 5 deletions src/components/character-preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from "@mui/material";
import { Link as RouterLink } from "react-router-dom";
import { TranslatedCharacterInfo } from "../consts/character-info";
const viteConfig = { base: "/genshin-helper-website" };
// import { TranslatedTravelerInfo } from "../consts/traveler-info";

interface CharacterPreviewProps {
Expand Down Expand Up @@ -46,7 +45,7 @@ const CharacterPreview = ({
height: "100%",
opacity: 0.7,
backgroundImage: `url(${!isTraveler
? `${viteConfig.base}/characters/${characterInfo.nameId}/name-card-p.png`
? `/genshin-helper-website/characters/${characterInfo.nameId}/name-card-p.png`
: ""
})`,
backgroundPosition: "center",
Expand All @@ -65,7 +64,7 @@ const CharacterPreview = ({
>
<Box
component="img"
src={`${viteConfig.base}/characters/${characterInfo.nameId}/icon.png`}
src={`/genshin-helper-website/characters/${characterInfo.nameId}/icon.png`}
width="102.39px"
height="102.39px"
sx={{ mt: "auto" }}
Expand Down Expand Up @@ -115,8 +114,8 @@ const CharacterPreview = ({
}`}
src={
isTraveler
? `${viteConfig.base}/weapon-types/sword.webp`
: `${viteConfig.base}/weapon-types/${characterInfo.weaponType.toLowerCase()}.webp`
? `/genshin-helper-website/weapon-types/sword.webp`
: `/genshin-helper-website/weapon-types/${characterInfo.weaponType.toLowerCase()}.webp`
}
sx={{ height: 24, width: 24 }}
>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/character.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const CharacterDisplayCard = ({
>
<SkillCard
skill={skillTalent}
index={skillTalent === characterInfo.energySkill ? `${viteConfig.base}/characters/${characterKey}/elemental-burst.png` : `${viteConfig.base}/characters/${characterKey}/skill-${index + 1}.png`}
index={skillTalent === characterInfo.energySkill ? `/genshin-helper-website/characters/${characterKey}/elemental-burst.png` : `/genshin-helper-website/characters/${characterKey}/skill-${index + 1}.png`}
/>
</Grid>
)
Expand All @@ -240,7 +240,7 @@ const CharacterDisplayCard = ({
>
<SkillCard
skill={passive}
index={`${viteConfig.base}/characters/${characterKey}/passive-${index + 1}.png`}
index={`/genshin-helper-website/characters/${characterKey}/passive-${index + 1}.png`}
/>
</Grid>
);
Expand All @@ -257,7 +257,7 @@ const CharacterDisplayCard = ({
<Grid item xs={12} sm={12} md={4} lg={4} key={index}>
<SkillCard
skill={constellation}
index={`${viteConfig.base}/characters/${characterKey}/constellation-${index + 1}.png`}
index={`/genshin-helper-website/characters/${characterKey}/constellation-${index + 1}.png`}
/>
</Grid>
);
Expand Down
3 changes: 1 addition & 2 deletions src/pages/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const PageHome = () => {
const brPt = useMediaQueryUp();
const toggleButtonSize = toggleButtonSizeMap[brPt];

const viteConfig = { base: "/genshin-helper-website" }

const [elementFilter, setElementFilter] = useLocalStorage("elementFilter", [
...allElements,
Expand Down Expand Up @@ -173,7 +172,7 @@ const PageHome = () => {
aria-label={weapon}
>
<Avatar
src={`${viteConfig.base}/weapon-types/${weapon}.webp`}
src={`/genshin-helper-website/weapon-types/${weapon}.webp`}
sx={{
width: toggleButtonSizeMap,
height: toggleButtonSizeMap,
Expand Down

0 comments on commit e237184

Please sign in to comment.