mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-25 09:26:17 -05:00
Adding CSS to invert FileCard Icons. Adding CardIcon in Theme to handle theme switching.
This commit is contained in:
parent
90f59a1a7b
commit
6362a12345
5 changed files with 18 additions and 8 deletions
|
|
@ -35,7 +35,7 @@ import Grid from "semantic-ui-react/dist/commonjs/collections/Grid";
|
|||
import Dropdown from "semantic-ui-react/dist/commonjs/modules/Dropdown";
|
||||
import _ from "lodash";
|
||||
import {ThemeContext} from "../contexts/contexts";
|
||||
import {Button, Header, Loader, Placeholder, Segment, Table} from "./Theme";
|
||||
import {Button, CardIcon, Header, Loader, Placeholder, Segment, Table} from "./Theme";
|
||||
|
||||
function ArchivePage() {
|
||||
const [deleteOpen, setDeleteOpen] = useState(false);
|
||||
|
|
@ -150,7 +150,7 @@ export function ArchiveCard({file}) {
|
|||
const imageSrc = archive.screenshot_path ? `/media/${encodeURIComponent(archive.screenshot_path)}` : null;
|
||||
const singlefileUrl = archive.singlefile_path ? `/media/${encodeURIComponent(archive.singlefile_path)}` : null;
|
||||
|
||||
let screenshot = <center className='card-icon'><FileIcon file={file}/></center>;
|
||||
let screenshot = <CardIcon><FileIcon file={file}/></CardIcon>;
|
||||
if (imageSrc) {
|
||||
screenshot = <Image src={imageSrc} wrapped style={{position: 'relative', width: '100%'}}/>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import Message from "semantic-ui-react/dist/commonjs/collections/Message";
|
|||
import {useDownloaders, useHotspot, useThrottle} from "../hooks/customHooks";
|
||||
import {getSettings} from "../api";
|
||||
import {darkTheme, SettingsContext, ThemeContext} from "../contexts/contexts";
|
||||
import {Button, Form, Header, Icon, Menu, Statistic} from "./Theme";
|
||||
import {Button, CardIcon, Form, Header, Icon, Menu, Statistic} from "./Theme";
|
||||
|
||||
export const API_URI = `http://${window.location.host}/api`;
|
||||
export const VIDEOS_API = `${API_URI}/videos`;
|
||||
|
|
@ -152,7 +152,7 @@ export function VideoCard({file}) {
|
|||
if (video.favorite) {
|
||||
imageLabel = {corner: 'left', icon: 'heart', color: 'green'};
|
||||
}
|
||||
let poster = <center className='card-icon'><FileIcon file={file}/></center>;
|
||||
let poster = <CardIcon><FileIcon file={file}/></CardIcon>;
|
||||
if (poster_url) {
|
||||
poster = <Image wrapped
|
||||
src={poster_url}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import {CardPlacholder} from "./Placeholder";
|
|||
import {ArchiveCard} from "./Archive";
|
||||
import Grid from "semantic-ui-react/dist/commonjs/collections/Grid";
|
||||
import {ThemeContext} from "../contexts/contexts";
|
||||
import {Button, Header, Icon, Placeholder, Segment, Table} from "./Theme";
|
||||
import {Button, CardIcon, Header, Icon, Placeholder, Segment, Table} from "./Theme";
|
||||
|
||||
const icons = {
|
||||
File: <Icon name='file'/>,
|
||||
|
|
@ -144,7 +144,7 @@ function ImageCard({file}) {
|
|||
const {s} = useContext(ThemeContext);
|
||||
const url = `/media/${encodeURIComponent(file.path)}`;
|
||||
|
||||
let poster = <center className='card-icon'><FileIcon file={file}/></center>;
|
||||
let poster = <CardIcon><FileIcon file={file}/></CardIcon>;
|
||||
if (file.size && file.size < 50000000) {
|
||||
// Image is less than 5mb, use it.
|
||||
poster = <Image wrapped
|
||||
|
|
@ -189,9 +189,9 @@ function FileCard({file}) {
|
|||
|
||||
return <Card color={color}>
|
||||
<ExternalCardLink to={url}>
|
||||
<center className='card-icon'>
|
||||
<CardIcon>
|
||||
<FileIcon file={file}/>
|
||||
</center>
|
||||
</CardIcon>
|
||||
</ExternalCardLink>
|
||||
<Card.Content {...s}>
|
||||
<Card.Header>
|
||||
|
|
|
|||
|
|
@ -216,3 +216,9 @@ export function TextArea(props) {
|
|||
props = invertedNull({...i, ...props});
|
||||
return <TEXTAREA {...props}/>
|
||||
}
|
||||
|
||||
export function CardIcon(props) {
|
||||
const {i} = useContext(ThemeContext);
|
||||
const inverted = i['inverted'] === true ? 'inverted' : null;
|
||||
return <center className={`card-icon ${inverted}`} {...props}/>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,3 +32,7 @@ textarea.otp {
|
|||
text-align: center;
|
||||
padding-top: 53px;
|
||||
}
|
||||
|
||||
.card-icon.inverted {
|
||||
background-color: #222222;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue