Skip to content

Commit

Permalink
Api Cleanup (#664)
Browse files Browse the repository at this point in the history
Use functions for api, not static class methods 👍
  • Loading branch information
lowtorola authored and acrantel committed Oct 3, 2023
1 parent cc86743 commit 42cfbd8
Show file tree
Hide file tree
Showing 7 changed files with 728 additions and 720 deletions.
3 changes: 1 addition & 2 deletions frontend2/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
"*.json",
".eslintrc.js",
"tailwind.config.js",
"**/types/**",
"src/utils/types",
],
parserOptions: {
project: "tsconfig.json",
Expand All @@ -28,7 +28,6 @@ module.exports = {
},
plugins: ["react"],
rules: {
indent: ["error", 2],
semi: ["error", "always"], // require semicolons ending statements
},
settings: {
Expand Down
3 changes: 3 additions & 0 deletions frontend2/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# production
/build

# auto-generated type
src/utils/types

/coverage

package-lock.json
16 changes: 8 additions & 8 deletions frontend2/src/components/BattlecodeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ function BattlecodeTable<T>({
className={
idx % 2 === 0
? `bg-white border-b ${
onRowClick !== undefined
? "cursor-pointer hover:bg-gray-100 hover:text-gray-700"
: ""
}}`
onRowClick !== undefined
? "cursor-pointer hover:bg-gray-100 hover:text-gray-700"
: ""
}}`
: `bg-gray-50 border-b ${
onRowClick !== undefined
? "cursor-pointer hover:bg-gray-100 hover:text-gray-700"
: ""
}`
onRowClick !== undefined
? "cursor-pointer hover:bg-gray-100 hover:text-gray-700"
: ""
}`
}
>
{columns.map((col, idx) => (
Expand Down
8 changes: 3 additions & 5 deletions frontend2/src/components/elements/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React from "react";

interface ButtonProps extends React.ComponentPropsWithoutRef<"button"> {
variant?: string;
Expand All @@ -7,12 +7,10 @@ interface ButtonProps extends React.ComponentPropsWithoutRef<"button"> {

const variants: Record<string, string> = {
"": "bg-gray-50 text-gray-900 hover:bg-gray-100 ring-gray-300 ring-1 ring-inset",
"dark": "bg-gray-700 text-gray-50 hover:bg-gray-800"
dark: "bg-gray-700 text-gray-50 hover:bg-gray-800",
};

const Button: React.FC<ButtonProps> = (
{ variant, label, ...rest }
) => {
const Button: React.FC<ButtonProps> = ({ variant, label, ...rest }) => {
variant = variant ?? "";
const variantStyle = variants[variant];
return (
Expand Down
Loading

0 comments on commit 42cfbd8

Please sign in to comment.