Browse Source

Add StyledPanel, rename original to CardPanel

- Fixes text color on light themes
master
jeffvli 3 years ago
committed by Jeff
parent
commit
7bd6b5c2c6
  1. 6
      src/components/card/Card.tsx
  2. 2
      src/components/card/styled.tsx
  3. 7
      src/components/search/SearchView.tsx
  4. 8
      src/components/settings/ConfigPanels/ListViewConfig.tsx
  5. 5
      src/components/shared/styled.ts

6
src/components/card/Card.tsx

@ -8,7 +8,7 @@ import { appendPlayQueue, fixPlayer2Index, setPlayQueue } from '../../redux/play
import { isCached } from '../../shared/utils'; import { isCached } from '../../shared/utils';
import { import {
StyledPanel, CardPanel,
InfoPanel, InfoPanel,
InfoSpan, InfoSpan,
CardTitleButton, CardTitleButton,
@ -112,7 +112,7 @@ const Card = ({
return ( return (
<> <>
<StyledPanel bordered shaded cardsize={size} style={rest.style}> <CardPanel bordered shaded cardsize={size} style={rest.style}>
<Overlay cardsize={size}> <Overlay cardsize={size}>
{lazyLoad ? ( {lazyLoad ? (
<LazyCardImg <LazyCardImg
@ -213,7 +213,7 @@ const Card = ({
)} )}
</InfoSpan> </InfoSpan>
</InfoPanel> </InfoPanel>
</StyledPanel> </CardPanel>
</> </>
); );
}; };

2
src/components/card/styled.tsx

@ -18,7 +18,7 @@ interface Card {
: props.theme.primary.cardSm; : props.theme.primary.cardSm;
}; */ }; */
export const StyledPanel = styled(Panel)<Card>` export const CardPanel = styled(Panel)<Card>`
text-align: center; text-align: center;
width: ${(props) => `${Number(props.cardsize) + 2}px`}; width: ${(props) => `${Number(props.cardsize) + 2}px`};
height: ${(props) => `${Number(props.cardsize) + 55}px`}; height: ${(props) => `${Number(props.cardsize) + 55}px`};

7
src/components/search/SearchView.tsx

@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
import _ from 'lodash'; import _ from 'lodash';
import settings from 'electron-settings'; import settings from 'electron-settings';
import { useQuery, useQueryClient } from 'react-query'; import { useQuery, useQueryClient } from 'react-query';
import { Panel } from 'rsuite';
import { search3, star, unstar } from '../../api/api'; import { search3, star, unstar } from '../../api/api';
import useRouterQuery from '../../hooks/useRouterQuery'; import useRouterQuery from '../../hooks/useRouterQuery';
import GenericPage from '../layout/GenericPage'; import GenericPage from '../layout/GenericPage';
@ -19,7 +18,7 @@ import {
import { fixPlayer2Index, setPlayQueueByRowClick } from '../../redux/playQueueSlice'; import { fixPlayer2Index, setPlayQueueByRowClick } from '../../redux/playQueueSlice';
import { setStatus } from '../../redux/playerSlice'; import { setStatus } from '../../redux/playerSlice';
import ListViewTable from '../viewtypes/ListViewTable'; import ListViewTable from '../viewtypes/ListViewTable';
import { SectionTitle, SectionTitleWrapper } from '../shared/styled'; import { SectionTitle, SectionTitleWrapper, StyledPanel } from '../shared/styled';
const SearchView = () => { const SearchView = () => {
const dispatch = useAppDispatch(); const dispatch = useAppDispatch();
@ -202,7 +201,7 @@ const SearchView = () => {
<SectionTitleWrapper> <SectionTitleWrapper>
<SectionTitle>Songs</SectionTitle> <SectionTitle>Songs</SectionTitle>
</SectionTitleWrapper> </SectionTitleWrapper>
<Panel bodyFill bordered> <StyledPanel bodyFill bordered>
<ListViewTable <ListViewTable
height={500} height={500}
data={data.song} data={data.song}
@ -226,7 +225,7 @@ const SearchView = () => {
virtualized virtualized
handleFavorite={handleRowFavorite} handleFavorite={handleRowFavorite}
/> />
</Panel> </StyledPanel>
</> </>
)} )}
</GenericPage> </GenericPage>

8
src/components/settings/ConfigPanels/ListViewConfig.tsx

@ -1,8 +1,8 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { nanoid } from 'nanoid/non-secure'; import { nanoid } from 'nanoid/non-secure';
import settings from 'electron-settings'; import settings from 'electron-settings';
import { TagPicker, ControlLabel, Panel } from 'rsuite'; import { TagPicker, ControlLabel } from 'rsuite';
import { StyledInputNumber } from '../../shared/styled'; import { StyledInputNumber, StyledPanel } from '../../shared/styled';
import ListViewTable from '../../viewtypes/ListViewTable'; import ListViewTable from '../../viewtypes/ListViewTable';
import { useAppDispatch, useAppSelector } from '../../../redux/hooks'; import { useAppDispatch, useAppSelector } from '../../../redux/hooks';
import { import {
@ -99,7 +99,7 @@ const ListViewConfig = ({ defaultColumns, columnPicker, columnList, settingsConf
return ( return (
<div style={{ width: '100%' }}> <div style={{ width: '100%' }}>
<div> <div>
<Panel bordered bodyFill> <StyledPanel bordered bodyFill>
<TagPicker <TagPicker
data={columnPicker} data={columnPicker}
defaultValue={defaultColumns} defaultValue={defaultColumns}
@ -161,7 +161,7 @@ const ListViewConfig = ({ defaultColumns, columnPicker, columnList, settingsConf
config={{ option: columnListType, columnList }} config={{ option: columnListType, columnList }}
virtualized virtualized
/> />
</Panel> </StyledPanel>
</div> </div>
<br /> <br />

5
src/components/shared/styled.ts

@ -12,6 +12,7 @@ import {
Slider, Slider,
InputPicker, InputPicker,
Popover, Popover,
Panel,
} from 'rsuite'; } from 'rsuite';
import styled from 'styled-components'; import styled from 'styled-components';
@ -217,3 +218,7 @@ export const StyledLink = styled.a`
color: ${(props) => props.theme.primary.text}; color: ${(props) => props.theme.primary.text};
cursor: pointer; cursor: pointer;
`; `;
export const StyledPanel = styled(Panel)`
color: ${(props) => props.theme.primary.text};
`;

Loading…
Cancel
Save