Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): replace styled-components/macro with styled-components #130

Merged
merged 2 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import './App.css';
import { Route, Switch } from 'react-router-dom';
import SignInPage from './pages/SignInPage';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/FormControls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import SquareButton, { LightSquareButton } from './inputs/SquareButton';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../utils/breakpoints';

const Container = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/Menu.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { NavLink } from 'react-router-dom';
import { device } from '../utils/breakpoints';
import { useSignOut } from '../SessionContext';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/MenuHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PersonCircle, QuestionSquare } from 'react-bootstrap-icons';
import { useCurrentSession, useSignOut } from '../SessionContext';
import { ReactComponent as Hamburger } from '../images/Hamburger.svg';
import { ReactComponent as Logo } from '../images/Nesis.svg';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../utils/breakpoints';
import client from '../utils/httpClient';
import { useConfig } from '../ConfigContext';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/MessageRow.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { ReactComponent as AttentionSign } from '../images/AttentionSign.svg';
import { ReactComponent as CloseMessageIcon } from '../images/CloseMessageIcon.svg';
import { device } from '../utils/breakpoints';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/Modal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactModal from 'react-modal';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { ReactComponent as CloseIcon } from '../images/CloseIcon.svg';
import { device } from '../utils/breakpoints';

Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/PaginationRow.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { ReactComponent as ChevronRight } from '../images/ChevronRight.svg';
import React, { useMemo, useRef, useState } from 'react';
import { countTotalPages, paginateList } from '../utils/paginationUtils';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/Spinner.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';

const Wrapper = styled.div`
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/StatusIcon.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';

const Main = styled.span`
margin-right: 4px;
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/Table.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import Spinner from './Spinner';
import SortIndicator from './table/SortIndicator';
import { ReactComponent as BinIcon } from '../images/BinIcon.svg';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/form/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { ErrorMessage, Field } from 'formik';
import TextInput from '../inputs/TextInput';
import ReactSelectStyled from '../inputs/Select';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/inputs/Checkbox.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';

const Wrapper = styled.div`
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/inputs/Select.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import Select from 'react-select';
import React from 'react';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';

const SquareButton = styled.button`
color: ${(props) => props.theme.white};
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/inputs/TextInput.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled, { css } from 'styled-components/macro';
import styled, { css } from 'styled-components';

export const LabelPosition = {
ON_INPUT_BORDER: 'ON_INPUT_BORDER',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import React from 'react';

const ResourceFieldTitle = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/layout/FormRow.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../utils/breakpoints';

const FormRow = styled.span`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../utils/breakpoints';

const FullPageFormContainer = styled.div`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled, { css } from 'styled-components/macro';
import styled, { css } from 'styled-components';
import useStateToggle from '../../utils/useStateToggle';
import { ReactComponent as ChevronRight } from '../../images/ChevronRight.svg';
import { device } from '../../utils/breakpoints';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { ReactComponent as AddIcon } from '../../images/AddIcon.svg';
import { device } from '../../utils/breakpoints';
import SquareButton, { LightSquareButton } from '../inputs/SquareButton';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/layout/Tabs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { useHistory, matchPath } from 'react-router-dom';

const Main = styled.div`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../utils/breakpoints';

const TwoColumnsContent = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/components/table/SearchInput.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import TextInput from '../inputs/TextInput';
import { ReactComponent as SearchIcon } from './SearchIcon.svg';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { ReactComponent as Ascending } from './Ascending.svg';
import { ReactComponent as Descending } from './Descending.svg';
import { ReactComponent as NoSortedBy } from './NoSortedBy.svg';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import SquareButton, { DangerSquareButton } from './inputs/SquareButton';
import Modal, { ButtonsContainer, ModalTitle } from './Modal';
import parseApiErrorMessage from '../utils/parseApiErrorMessage';
import MessageRow from '../components/MessageRow';
import styled from 'styled-components/macro';
import styled from 'styled-components';

const CancelButton = styled(SquareButton)`
background-color: ${(props) => props.theme.primaryLight};
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRoot } from 'react-dom/client';
import './index.css';
import App from './App';
import { BrowserRouter as Router, Route } from 'react-router-dom';
import { ThemeProvider } from 'styled-components/macro';
import { ThemeProvider } from 'styled-components';
import theme from './utils/theme';
import { SessionProvider } from './SessionContext';
import { ToasterContextProvider } from './ToasterContext';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/pages/DocumentGPT/ChatPage.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useState } from 'react';
import { useHistory, Route, Switch, useRouteMatch } from 'react-router-dom';
import Nesis from '../../components/Menu';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { FileEarmarkPost } from 'react-bootstrap-icons';
import {
Box,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useAddToast } from '../../../ToasterContext';
import { ModalTitle } from '../../../components/Modal';
import MessageRow from '../../../components/MessageRow';
import Table from '../../../components/Table';
import styled from 'styled-components/macro';
import styled from 'styled-components';

const StyledTable = styled(Table)``;

Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/pages/Settings/Apps/AppsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OutlinedSquareButton,
EditOutlinedSquareButton,
} from '../../../components/inputs/SquareButton';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../../utils/breakpoints';
import Table, { DeleteItemButton } from '../../../components/Table';
import { useHistory, useRouteMatch, useLocation } from 'react-router-dom';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ModalTitle } from '../../../components/Modal';
import MessageRow from '../../../components/MessageRow';
import FormRow, { Column } from '../../../components/layout/FormRow';
import Table, { DeleteItemButton } from '../../../components/Table';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../../utils/breakpoints';
import { func } from 'prop-types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OutlinedSquareButton,
EditOutlinedSquareButton,
} from '../../../components/inputs/SquareButton';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../../utils/breakpoints';
import Table, { DeleteItemButton } from '../../../components/Table';
import { useHistory, useRouteMatch } from 'react-router-dom';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ModalTitle } from '../../../components/Modal';
import MessageRow from '../../../components/MessageRow';
import FormRow, { Column } from '../../../components/layout/FormRow';
import Table, { DeleteItemButton } from '../../../components/Table';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../../utils/breakpoints';

const EngineOptions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
LightSquareButton,
OutlinedSquareButton,
} from '../../../components/inputs/SquareButton';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../../utils/breakpoints';
import Table, { DeleteItemButton } from '../../../components/Table';
import { useHistory, useRouteMatch } from 'react-router-dom';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ModalTitle } from '../../../components/Modal';
import MessageRow from '../../../components/MessageRow';
import FormRow, { Column } from '../../../components/layout/FormRow';
import Table, { DeleteItemButton } from '../../../components/Table';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../../utils/breakpoints';

const EngineOptions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OutlinedSquareButton,
EditOutlinedSquareButton,
} from '../../../components/inputs/SquareButton';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../../utils/breakpoints';
import Table, { DeleteItemButton } from '../../../components/Table';
import { useHistory, useRouteMatch, useLocation } from 'react-router-dom';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/pages/Settings/SettingPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import UsersPage from './Users/UsersPage';
import RolesPage from './Roles/RolesPage';
import AppsPage from './Apps/AppsPage';
import Nesis from '../../components/Menu';
import styled from 'styled-components/macro';
import styled from 'styled-components';

const Heading = styled.h1`
background-image: linear-gradient(to right, #089fdf 21%, #5dd375 100%);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { ModalTitle } from '../../../components/Modal';
import MessageRow from '../../../components/MessageRow';
import FormRow, { Column } from '../../../components/layout/FormRow';
import Table, { DeleteItemButton } from '../../../components/Table';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../../utils/breakpoints';
import { Field } from 'formik';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
OutlinedSquareButton,
EditOutlinedSquareButton,
} from '../../../components/inputs/SquareButton';
import styled from 'styled-components/macro';
import styled from 'styled-components';
import { device } from '../../../utils/breakpoints';
import Table, { DeleteItemButton } from '../../../components/Table';
import { useHistory, useRouteMatch, useLocation } from 'react-router-dom';
Expand Down
2 changes: 1 addition & 1 deletion nesis/frontend/client/src/utils/buttonStyles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { device } from './breakpoints';
import { css } from 'styled-components/macro';
import { css } from 'styled-components';

export const ButtonColor = {
Primary: {
Expand Down