Skip to content

Commit

Permalink
Add color constants and update color usage
Browse files Browse the repository at this point in the history
  • Loading branch information
truemiller committed Feb 22, 2024
1 parent 5129598 commit 6d11939
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion frontend/components/Spawn/Funding/Funding.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Service } from '@/client';
import { COLOR } from '@/constants';
import { SpawnScreenState } from '@/enums';
import { useSpawn } from '@/hooks';
import { Address } from '@/types';
Expand Down Expand Up @@ -70,7 +71,7 @@ export const Funding = ({
contractAddress={contractAddress}
/>
),
color: receivedFunds[address] ? 'green' : 'red',
color: receivedFunds[address] ? COLOR.GREEN_2 : COLOR.RED,
};
}) as TimelineItemProps[],
[
Expand Down
7 changes: 4 additions & 3 deletions frontend/components/Spawn/SpawnRPC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
import { NODIES_URL } from '@/constants/urls';
import {
Dispatch,
ReactElement,
SetStateAction,
useCallback,
useMemo,
Expand All @@ -20,7 +21,7 @@ import { useSpawn, useEthers } from '@/hooks';
import { SpawnScreenState } from '@/enums';
import { CheckSquareTwoTone, WarningFilled } from '@ant-design/icons';
import { InputStatus } from 'antd/es/_util/statusUtils';
import _ from 'lodash';
import { debounce } from 'lodash';

enum RPCState {
LOADING,
Expand Down Expand Up @@ -54,7 +55,7 @@ export const SpawnRPC = ({ rpc, setRpc, nextPage }: SpawnRPCProps) => {

// eslint-disable-next-line react-hooks/exhaustive-deps
const debounceCheckRpc = useCallback(
_.debounce((_rpc: string) => {
debounce((_rpc: string) => {
if (isCheckingRpc) return;
if (!_rpc) return;
setIsCheckingRpc(true);
Expand Down Expand Up @@ -98,7 +99,7 @@ export const SpawnRPC = ({ rpc, setRpc, nextPage }: SpawnRPCProps) => {
[rpcState],
);

const inputSuffix: JSX.Element = useMemo(() => {
const inputSuffix: ReactElement = useMemo(() => {
switch (rpcState) {
case RPCState.LOADING:
return <Spin />;
Expand Down
4 changes: 4 additions & 0 deletions frontend/constants/color.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const COLOR = {
RED: '#EA3324',
GREEN_2: '#00F422',
};
1 change: 1 addition & 0 deletions frontend/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * from './contracts';
export * from './serviceTemplates';
export * from './tokens';
export * from './urls';
export * from './color';

0 comments on commit 6d11939

Please sign in to comment.