Skip to content

Commit

Permalink
fix colors
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Jan 14, 2025
1 parent bf82425 commit c6a4e70
Show file tree
Hide file tree
Showing 20 changed files with 105 additions and 55 deletions.
14 changes: 6 additions & 8 deletions packages/react-kit/src/components/buttons/BaseButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ const ButtonWithThemeProps = styled.button<ButtonWithThemePropsType>`
background-color: ${(props) => props.theme?.background || "transparent"};
svg {
stroke: ${(props) => props.theme?.color || "#000000"};
${(props) =>
props.theme.svg &&
css`
stroke: ${(props) => props.theme?.svg.stroke};
${props.theme.svg.fill &&
css`
fill: ${props.theme.svg.fill};
Expand Down Expand Up @@ -94,18 +94,15 @@ const ButtonWithThemeProps = styled.button<ButtonWithThemePropsType>`
`};
svg {
fill: ${props.theme.hover?.svg?.fill || props.theme.hover.color};
fill: ${props.theme.hover?.svg?.fill};
line {
stroke: ${props.theme.hover?.svg?.line?.stroke ||
props.theme.hover.color};
stroke: ${props.theme.hover?.svg?.line?.stroke};
}
polyline {
stroke: ${props.theme.hover?.svg?.polyline?.stroke ||
props.theme.hover.color};
stroke: ${props.theme.hover?.svg?.polyline?.stroke};
}
path {
stroke: ${props.theme.hover?.svg?.path?.stroke ||
props.theme.hover.color};
stroke: ${props.theme.hover?.svg?.path?.stroke};
${props.theme.hover?.svg?.path?.fill &&
css`
fill: ${props.theme.hover?.svg?.path?.fill};
Expand Down Expand Up @@ -155,6 +152,7 @@ const ButtonWithThemeProps = styled.button<ButtonWithThemePropsType>`
`;

type SvgTheme = Partial<{
stroke: CSSProperties["color"];
fill: CSSProperties["color"];
line: Partial<{
stroke: CSSProperties["color"];
Expand Down
14 changes: 9 additions & 5 deletions packages/react-kit/src/components/chat/InitializeChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { Grid } from "../ui/Grid";
import ThemedButton from "../ui/ThemedButton";
import { Typography } from "../ui/Typography";
import { Spinner } from "../ui/loading/Spinner";
import { colors } from "../../theme";
import { colors, getCssVar } from "../../theme";
import { useChatContext } from "./ChatProvider/ChatContext";
import { useAccount } from "../../hooks/connection/connection";
import { BosonConnectWallet } from "../wallet2/web3Status/BosonConnectWallet";

const Info = styled(Grid)`
display: flex;
justify-content: space-between;
background-color: ${colors.greyLight};
background-color: ${getCssVar("--background-color")};
padding: 1.5rem;
`;

Expand Down Expand Up @@ -61,9 +61,13 @@ export default function InitializeChat({ isError = false }: Props) {
<ThemedButton
type="button"
themeVal="accentFill"
style={{
color: colors.white
}}
style={
isInitializing
? undefined
: {
color: colors.white
}
}
disabled={isInitializing}
onClick={() => {
initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ import { useChatStatus } from "./useChatStatus";
import { Grid } from "../ui/Grid";
import InitializeChat from "./InitializeChat";
import { Typography } from "../ui/Typography";
import { colors, getCssVar } from "../../theme";

const CheckIcon = styled(CheckCircle)`
color: var(--primary);
color: ${getCssVar("--main-accent-color")};
path {
stroke: var(--primary);
stroke: ${getCssVar("--main-accent-color")};
}
`;
const ChatDotsIcon = styled(ChatDots)`
fill: var(--accent);
fill: ${colors.violet};
path {
stroke: var(--accent);
stroke: ${colors.violet};
}
`;

Expand Down
2 changes: 1 addition & 1 deletion packages/react-kit/src/components/error/SimpleError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function SimpleError({
$background={backgroundColor}
{...rest}
>
<Warning color={warningColor} size={16} />
<Warning color={warningColor} size={16} style={{ minWidth: "1rem" }} />
{children ? (
children
) : (
Expand Down
4 changes: 2 additions & 2 deletions packages/react-kit/src/components/form/BaseSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { checkIfValueIsEmpty } from "../../lib/object/checkIfValueIsEmpty";
import { colors } from "../../theme";
import { zIndex } from "../ui/zIndex";
import type { BaseSelectProps, SelectDataProps } from "./types";
import { useFixSelectFontSize } from "../../hooks/form/useFixSelectFontSize";
import { useFixSelectFont } from "../../hooks/form/useFixSelectFont";

const customStyles = (error: any) => ({
control: (provided: any, state: any) => ({
Expand Down Expand Up @@ -56,7 +56,7 @@ export default function BaseSelect({
const handleChange = (option: SingleValue<SelectDataProps>) => {
onChange?.(option);
};
const { jsx, selectClassName } = useFixSelectFontSize({
const { jsx, selectClassName } = useFixSelectFont({
selectClassName: "boson-base-select"
});
return (
Expand Down
7 changes: 4 additions & 3 deletions packages/react-kit/src/components/form/CountrySelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import type { BaseProps, SupportedReactSelectProps } from "./types";
import { SelectDataProps } from "./types";
import { colors, getCssVar } from "../../theme";
import { checkIfValueIsEmpty } from "../../lib/object/checkIfValueIsEmpty";
import { useFixSelectFontSize } from "../../hooks/form/useFixSelectFontSize";
import { useFixSelectFont } from "../../hooks/form/useFixSelectFont";
import { inputStyles } from "./styles";
export type { Country as CountryCode } from "react-phone-number-input";

const customStyles = (
Expand All @@ -43,7 +44,7 @@ const customStyles = (
alignContent: "center",
padding: "0.4rem 1rem",
boxShadow: "none",
background: getCssVar("--background-color"),
background: inputStyles.background,
...customTheme?.control,
border: state.isFocused
? customTheme?.control?.focus?.border ?? `1px solid ${colors.violet}`
Expand Down Expand Up @@ -219,7 +220,7 @@ export function CountrySelect({
setInitialized(true);
}
}, [field.value, initialized]); // eslint-disable-line
const { jsx, selectClassName } = useFixSelectFontSize({
const { jsx, selectClassName } = useFixSelectFont({
selectClassName: "country-select"
});
return (
Expand Down
16 changes: 16 additions & 0 deletions packages/react-kit/src/components/form/Field.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export type InputTheme = {
background: CSSProperties["backgroundColor"];
borderColor: CSSProperties["borderColor"];
borderRadius: CSSProperties["borderRadius"];
color: CSSProperties["color"];
placeholder: {
color: CSSProperties["color"];
};
focus: {
caretColor: CSSProperties["caretColor"];
};
Expand Down Expand Up @@ -58,8 +62,20 @@ export const FieldInput = styled.input<{
background: ${(props) => props.theme?.background || "transparent"};
border: 1px solid ${(props) => props.theme?.borderColor || colors.border};
border-radius: ${(props) => props.theme?.borderRadius || 0}px;
color: ${(props) => props.theme?.color};
outline: none;
&::placeholder {
color: ${(props) => props.theme?.placeholder?.color};
opacity: 1;
}
&:-ms-input-placeholder {
color: ${(props) => props.theme?.placeholder?.color};
}
&::-ms-input-placeholder {
color: ${(props) => props.theme?.placeholder?.color};
}
${transition}
&:not(:disabled) {
Expand Down
7 changes: 6 additions & 1 deletion packages/react-kit/src/components/form/Input.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import React from "react";
import { colors, getCssVar } from "../../theme";
import { BaseInput, BaseInputProps } from "./BaseInput";
import { inputStyles } from "./styles";

const bosonTheme = {
background: getCssVar("--background-color"),
background: inputStyles.background,
borderColor: getCssVar("--border-color"),
color: inputStyles.color,
borderRadius: 0,
placeholder: {
color: inputStyles.placeholder.color
},
focus: {
caretColor: "initial"
},
Expand Down
10 changes: 6 additions & 4 deletions packages/react-kit/src/components/form/Phone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import Error from "./Error";
import { FieldInput } from "./Field.styles";
import type { InputProps } from "./types";
import { SelectDataProps } from "./types";
import { useFixSelectFontSize } from "../../hooks/form/useFixSelectFontSize";
import { useFixSelectFont } from "../../hooks/form/useFixSelectFont";
import { inputStyles } from "./styles";

const customStyles = {
control: (provided: any, state: any) => {
Expand All @@ -42,7 +43,7 @@ const customStyles = {
borderColor: colors.violet,
borderWidth: "1px"
},
background: getCssVar("--background-color"),
background: inputStyles.background,
border: state.isFocused
? `1px solid ${colors.violet}`
: `1px solid ${getCssVar("--border-color")}`,
Expand Down Expand Up @@ -112,8 +113,9 @@ export const PhoneWrapper = styled.div`
width: 100%;
padding: 1rem;
gap: 0.5rem;
background: ${getCssVar("--background-color")};
background: ${getCssVar("--background-accent-color")};
border: 1px solid ${getCssVar("--border-color")};
color: ${getCssVar("--main-text-color")};
border-radius: 0;
outline: none;
font-family: "Plus Jakarta Sans";
Expand Down Expand Up @@ -184,7 +186,7 @@ export default function Phone({ name, ...props }: InputProps) {
}
}, [field.value, initialized]); // eslint-disable-line

const { jsx, selectClassName } = useFixSelectFontSize({
const { jsx, selectClassName } = useFixSelectFont({
selectClassName: "phone-select"
});
return (
Expand Down
4 changes: 2 additions & 2 deletions packages/react-kit/src/components/form/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { zIndex } from "../ui/zIndex";

import Error from "./Error";
import type { SelectDataProps, SelectProps } from "./types";
import { useFixSelectFontSize } from "../../hooks/form/useFixSelectFontSize";
import { useFixSelectFont } from "../../hooks/form/useFixSelectFont";
export type { SelectProps } from "./types";

const customStyles = <Option extends Record<string, unknown> = SelectDataProps>(
Expand Down Expand Up @@ -139,7 +139,7 @@ export default function SelectComponent<
helpers.setTouched(true);
}
};
const { jsx, selectClassName } = useFixSelectFontSize({
const { jsx, selectClassName } = useFixSelectFont({
selectClassName: "boson-select"
});
return (
Expand Down
9 changes: 9 additions & 0 deletions packages/react-kit/src/components/form/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { getCssVar } from "../../theme";

export const inputStyles = {
background: getCssVar("--background-accent-color"),
color: getCssVar("--main-text-color"),
placeholder: {
color: getCssVar("--sub-text-color")
}
} as const;
3 changes: 1 addition & 2 deletions packages/react-kit/src/components/modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ const Wrapper = styled.div<{
position: relative;
z-index: ${zIndex.Modal};
color: ${getCssVar("--main-text-color")};
background-color: ${getCssVar("--background-accent-color")};
border: var(--secondary);
background-color: ${getCssVar("--background-color")};
border-radius: ${getCssVar("--modal-border-radius")};
overflow: hidden;
${({ $maxWidths }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,15 @@ export const RedeemWhatsNext = ({
<Button
style={{ flex: "1 1 50%" }}
onClick={() => {
showModal("REQUEST_SHIPMENT", {
exchange,
...requestShipmentProps
});
showModal(
"REQUEST_SHIPMENT",
{
exchange,
...requestShipmentProps
},
"auto",
{ xs: "550px" }
);
}}
>
Request shipment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useAddPendingTransactionWithContext } from "../../../../../hooks/transa
import { useCoreSDKWithContext } from "../../../../../hooks/core-sdk/useCoreSdkWithContext";
import { poll } from "../../../../../lib/promises/promises";

import { colors } from "../../../../../theme";
import { colors, getCssVar } from "../../../../../theme";
import { useChatContext } from "../../../../chat/ChatProvider/ChatContext";
import InitializeChatWithSuccess from "../../../../chat/InitializeChatWithSuccess";
import { useChatStatus } from "../../../../chat/useChatStatus";
Expand Down Expand Up @@ -46,7 +46,7 @@ import { useRedemptionContext } from "../../../../widgets/redemption/provider/Re
import { extractUserFriendlyError } from "../../../../../lib/errors/transactions";

const StyledGrid = styled(Grid)`
background-color: ${colors.greyLight};
background-color: ${getCssVar("--background-color")};
`;

const StyledRedeemButton = styled(ThemedButton)``;
Expand Down Expand Up @@ -319,7 +319,11 @@ ${FormModel.formFields.walletAddress.placeholder}: ${message.deliveryDetails.wal
margin="1.5rem 0"
padding="1.5rem"
>
<Warning color={colors.orangeDark} size={16} />
<Warning
color={colors.orangeDark}
size={16}
style={{ minWidth: "1rem" }}
/>
<Typography fontWeight="600" fontSize="1rem" lineHeight="1.5rem">
rNFTs are burned upon redemption to prevent double spend
</Typography>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { ReactNode } from "react";
import styled, { css } from "styled-components";
import { CONFIG } from "../../../../../lib/config/config";
import { Typography } from "../../../../ui/Typography";
import { colors } from "../../../../../theme";
import { colors, getCssVar } from "../../../../../theme";
import { onlyFairExchangePolicyLabel } from "../../../../../lib/const/policies";

const InfoTitleWrapper = styled.div`
Expand Down Expand Up @@ -36,7 +36,7 @@ const InfoListItem = styled.li`
p {
margin: 0;
color: ${colors.greyDark};
color: ${getCssVar("--sub-text-color")};
}
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Grid } from "../../../../ui/Grid";
import { Button } from "../../../../buttons/Button";
import { colors } from "../../../../../theme";
import { colors, getCssVar } from "../../../../../theme";
import { CheckCircle } from "phosphor-react";
import { Typography } from "../../../../ui/Typography";

Expand Down Expand Up @@ -30,7 +30,7 @@ export const RequestShipmentSuccess = ({
>
<CheckCircle
weight="fill"
color={colors.green}
color={getCssVar("--main-accent-color")}
style={{ minWidth: "42px", minHeight: "42px" }}
/>
<Typography fontSize="1.25rem" fontWeight={600}>
Expand All @@ -43,10 +43,6 @@ export const RequestShipmentSuccess = ({
justifyContent="center"
gap="0.25rem"
padding="1.5rem 1rem"
style={{
borderRadius: "0.25rem",
border: `2px solid ${colors.greyLight}`
}}
>
<Typography fontSize="1rem" fontWeight={600}>
What’s next?
Expand All @@ -63,7 +59,7 @@ export const RequestShipmentSuccess = ({
</Grid>
<div
style={{
border: `1px solid ${colors.greyLight}`,
border: `1px solid ${getCssVar("--background-accent-color")}`,
width: "calc(100% + 2rem * 2)"
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Wrapper = styled.div<{ $flexWrap: string }>`
padding: 1rem 2rem;
display: flex;
flex-wrap: ${({ $flexWrap }) => $flexWrap};
border-bottom: 2px solid ${getCssVar("--border-color")};
border-bottom: 2px solid ${getCssVar("--background-accent-color")};
align-items: flex-end;
justify-content: space-between;
gap: 0.5rem;
Expand Down
Loading

0 comments on commit c6a4e70

Please sign in to comment.