Skip to content

Commit

Permalink
feat: update Typography comps
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-anderson committed Dec 15, 2022
1 parent 84d2104 commit e143dec
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/Typography/ErrorMessage.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import renderer from "react-test-renderer";
import { ErrorMessage } from "./ErrorMessage";
import { ThemeProvider } from "../../app/ThemeProvider";
import { ThemeProvider } from "@app/ThemeProvider";

it("renders correctly", () => {
// ThemeProvider is necessary to be able to access prop.theme in styled css.
Expand Down
5 changes: 2 additions & 3 deletions src/components/Typography/ErrorMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from "react";
import { useTheme } from "@mui/material/styles";
import styled from "@emotion/styled";
import { Text } from "./Text";
import { node, string } from "../../types";
import { node, string } from "@types";

export const ErrorMessage = ({
error,
Expand All @@ -12,7 +11,7 @@ export const ErrorMessage = ({
const { palette } = useTheme();

return (
<StyledErrorBox style={{ visibility: !!error ? "visible" : "hidden" }} {...props}>
<StyledErrorBox style={{ visibility: error ? "visible" : "hidden" }} {...props}>
<StyledErrorText style={{ color: palette.error.main }}>
{children ?? error ?? ""}
</StyledErrorText>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Typography/Text.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import renderer from "react-test-renderer";
import { Text } from "./Text";
import { ThemeProvider } from "../../app/ThemeProvider";
import { ThemeProvider } from "@app/ThemeProvider";

it("renders correctly", () => {
// ThemeProvider is necessary to be able to access prop.theme in styled css.
Expand Down
3 changes: 1 addition & 2 deletions src/components/Typography/Text.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import styled from "@emotion/styled";
import { useTheme } from "@mui/material/styles";
import { node } from "../../types";
import { node } from "@types";

export const Text = ({
variant = "primary",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Typography/Title.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import renderer from "react-test-renderer";
import { Title } from "./Title";
import { ThemeProvider } from "../../app/ThemeProvider";
import { ThemeProvider } from "@app/ThemeProvider";

it("renders correctly", () => {
// ThemeProvider is necessary to be able to access prop.theme in styled css.
Expand Down
3 changes: 1 addition & 2 deletions src/components/Typography/Title.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import styled from "@emotion/styled";
import { useTheme } from "@mui/material/styles";
import { node } from "../../types";
import { node } from "@types";

export const Title = ({
variant = "primary",
Expand Down

0 comments on commit e143dec

Please sign in to comment.