Skip to content

Commit

Permalink
Refactor code and remove unused CSS class
Browse files Browse the repository at this point in the history
  • Loading branch information
gvorbeck committed Jan 28, 2024
1 parent 6574d95 commit 2119b2c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 30 deletions.
4 changes: 2 additions & 2 deletions src/components/NewContentWrapper/NewContentWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Divider, Flex, Typography } from "antd";
import classNames from "classnames";
import React, { useEffect, useState } from "react";
import { marked } from "marked";
import { newGameCharacterPageTitleClassNames } from "@/support/cssSupport";

interface NewContentWrapperProps {
title: string;
Expand All @@ -18,7 +17,8 @@ const NewContentWrapper: React.FC<
> = ({ className, title, markedDesc, children }) => {
const [htmlContent, setHtmlContent] = useState("");
const newContentWrapperClassNames = classNames(className, "mt-4");

const newGameCharacterPageTitleClassNames =
"m-0 font-enchant leading-none tracking-wide";
useEffect(() => {
const parseMarkdown = async () => {
try {
Expand Down
22 changes: 0 additions & 22 deletions src/support/colorSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,6 @@ export enum ColorScheme {
RUST = "#965247",
}

export const hexToRgba = (hex: string, alpha = 1) => {
// Ensure the hex value starts with a hash symbol
const sanitizedHex = hex.startsWith("#") ? hex : "#" + hex;

// Extract red, green, and blue values
const [r, g, b] =
sanitizedHex.length === 7
? [
parseInt(sanitizedHex.slice(1, 3), 16),
parseInt(sanitizedHex.slice(3, 5), 16),
parseInt(sanitizedHex.slice(5, 7), 16),
]
: [
parseInt(sanitizedHex.slice(1, 2).repeat(2), 16),
parseInt(sanitizedHex.slice(2, 3).repeat(2), 16),
parseInt(sanitizedHex.slice(3, 4).repeat(2), 16),
];

// Return the RGBA string
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
};

export const darkenHexColor = (hex: string, percent: number): string => {
// Convert hex to RGB first
let r = parseInt(hex.substring(1, 3), 16);
Expand Down
3 changes: 0 additions & 3 deletions src/support/cssSupport.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
export const avatarClassNames =
"shadow-md border-solid border-2 border-seaBuckthorn";

export const newGameCharacterPageTitleClassNames =
"m-0 font-enchant leading-none tracking-wide";
3 changes: 0 additions & 3 deletions src/support/equipmentSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ export const equipmentSubCategoryMap = () => {
return equipmentSubCategories;
};

export const getItemsByCategory = (category: string) =>
equipmentCategoryMap()[category];

export const punchItem: EquipmentItem = {
name: "Punch**",
costValue: 0,
Expand Down

0 comments on commit 2119b2c

Please sign in to comment.