move hacky .css files into emotion
This commit is contained in:
parent
da3b690645
commit
441f6550db
6 changed files with 48 additions and 54 deletions
|
@ -1,12 +0,0 @@
|
||||||
.item-list-row-exit {
|
|
||||||
opacity: 1;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.item-list-row-exit-active {
|
|
||||||
opacity: 0;
|
|
||||||
height: 0 !important;
|
|
||||||
margin-top: 0 !important;
|
|
||||||
margin-bottom: 0 !important;
|
|
||||||
transition: all 0.5s;
|
|
||||||
}
|
|
|
@ -10,8 +10,6 @@ import {
|
||||||
useTheme,
|
useTheme,
|
||||||
} from "@chakra-ui/core";
|
} from "@chakra-ui/core";
|
||||||
|
|
||||||
import "./ItemList.css";
|
|
||||||
|
|
||||||
export function ItemListContainer({ children }) {
|
export function ItemListContainer({ children }) {
|
||||||
return <Flex direction="column">{children}</Flex>;
|
return <Flex direction="column">{children}</Flex>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
.items-panel-zone-exit {
|
|
||||||
opacity: 1;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.items-panel-zone-exit-active {
|
|
||||||
opacity: 0;
|
|
||||||
height: 0 !important;
|
|
||||||
margin-top: 0 !important;
|
|
||||||
margin-bottom: 0 !important;
|
|
||||||
transition: all 0.5s;
|
|
||||||
}
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { css } from "emotion";
|
||||||
import {
|
import {
|
||||||
Box,
|
Box,
|
||||||
Editable,
|
Editable,
|
||||||
|
@ -15,8 +16,6 @@ import { CSSTransition, TransitionGroup } from "react-transition-group";
|
||||||
import { Delay, Heading1, Heading2 } from "./util";
|
import { Delay, Heading1, Heading2 } from "./util";
|
||||||
import { ItemListContainer, Item, ItemListSkeleton } from "./ItemList";
|
import { ItemListContainer, Item, ItemListSkeleton } from "./ItemList";
|
||||||
|
|
||||||
import "./ItemsPanel.css";
|
|
||||||
|
|
||||||
function ItemsPanel({ outfitState, loading, dispatchToOutfit }) {
|
function ItemsPanel({ outfitState, loading, dispatchToOutfit }) {
|
||||||
const { zonesAndItems } = outfitState;
|
const { zonesAndItems } = outfitState;
|
||||||
|
|
||||||
|
@ -45,7 +44,20 @@ function ItemsPanel({ outfitState, loading, dispatchToOutfit }) {
|
||||||
{zonesAndItems.map(({ zoneLabel, items }) => (
|
{zonesAndItems.map(({ zoneLabel, items }) => (
|
||||||
<CSSTransition
|
<CSSTransition
|
||||||
key={zoneLabel}
|
key={zoneLabel}
|
||||||
classNames="items-panel-zone"
|
classNames={css`
|
||||||
|
&-exit {
|
||||||
|
opacity: 1;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-exit-active {
|
||||||
|
opacity: 0;
|
||||||
|
height: 0 !important;
|
||||||
|
margin-top: 0 !important;
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
transition: all 0.5s;
|
||||||
|
}
|
||||||
|
`}
|
||||||
timeout={500}
|
timeout={500}
|
||||||
onExit={(e) => {
|
onExit={(e) => {
|
||||||
e.style.height = e.offsetHeight + "px";
|
e.style.height = e.offsetHeight + "px";
|
||||||
|
@ -97,7 +109,20 @@ function ItemRadioList({ name, items, outfitState, dispatchToOutfit }) {
|
||||||
{items.map((item) => (
|
{items.map((item) => (
|
||||||
<CSSTransition
|
<CSSTransition
|
||||||
key={item.id}
|
key={item.id}
|
||||||
classNames="item-list-row"
|
classNames={css`
|
||||||
|
&-exit {
|
||||||
|
opacity: 1;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-exit-active {
|
||||||
|
opacity: 0;
|
||||||
|
height: 0 !important;
|
||||||
|
margin-top: 0 !important;
|
||||||
|
margin-bottom: 0 !important;
|
||||||
|
transition: all 0.5s;
|
||||||
|
}
|
||||||
|
`}
|
||||||
timeout={500}
|
timeout={500}
|
||||||
onExit={(e) => {
|
onExit={(e) => {
|
||||||
e.style.height = e.offsetHeight + "px";
|
e.style.height = e.offsetHeight + "px";
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
.outfit-preview-layer-exit {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.outfit-preview-layer-exit-active {
|
|
||||||
opacity: 0;
|
|
||||||
transition: opacity 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.outfit-preview-layer-image {
|
|
||||||
opacity: 0.01;
|
|
||||||
}
|
|
||||||
|
|
||||||
.outfit-preview-layer-image[src] {
|
|
||||||
opacity: 1;
|
|
||||||
transition: opacity 0.2s;
|
|
||||||
}
|
|
|
@ -1,4 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { css } from "emotion";
|
||||||
import { CSSTransition, TransitionGroup } from "react-transition-group";
|
import { CSSTransition, TransitionGroup } from "react-transition-group";
|
||||||
import gql from "graphql-tag";
|
import gql from "graphql-tag";
|
||||||
import { useQuery } from "@apollo/react-hooks";
|
import { useQuery } from "@apollo/react-hooks";
|
||||||
|
@ -20,8 +21,6 @@ import { Delay } from "./util";
|
||||||
import OutfitResetModal from "./OutfitResetModal";
|
import OutfitResetModal from "./OutfitResetModal";
|
||||||
import SpeciesColorPicker from "./SpeciesColorPicker";
|
import SpeciesColorPicker from "./SpeciesColorPicker";
|
||||||
|
|
||||||
import "./OutfitPreview.css";
|
|
||||||
|
|
||||||
export const itemAppearanceFragment = gql`
|
export const itemAppearanceFragment = gql`
|
||||||
fragment AppearanceForOutfitPreview on Appearance {
|
fragment AppearanceForOutfitPreview on Appearance {
|
||||||
layers {
|
layers {
|
||||||
|
@ -90,10 +89,16 @@ function OutfitPreview({ outfitState, dispatchToOutfit }) {
|
||||||
{visibleLayers.map((layer) => (
|
{visibleLayers.map((layer) => (
|
||||||
<CSSTransition
|
<CSSTransition
|
||||||
key={layer.id}
|
key={layer.id}
|
||||||
classNames={{
|
classNames={css`
|
||||||
exit: "outfit-preview-layer-exit",
|
&-exit {
|
||||||
exitActive: "outfit-preview-layer-exit-active",
|
opacity: 1;
|
||||||
}}
|
}
|
||||||
|
|
||||||
|
&-exit-active {
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
}
|
||||||
|
`}
|
||||||
timeout={200}
|
timeout={200}
|
||||||
>
|
>
|
||||||
<FullScreenCenter>
|
<FullScreenCenter>
|
||||||
|
@ -102,7 +107,14 @@ function OutfitPreview({ outfitState, dispatchToOutfit }) {
|
||||||
objectFit="contain"
|
objectFit="contain"
|
||||||
maxWidth="100%"
|
maxWidth="100%"
|
||||||
maxHeight="100%"
|
maxHeight="100%"
|
||||||
className="outfit-preview-layer-image"
|
className={css`
|
||||||
|
opacity: 0.01;
|
||||||
|
|
||||||
|
&[src] {
|
||||||
|
opacity: 1;
|
||||||
|
transition: opacity 0.2s;
|
||||||
|
}
|
||||||
|
`}
|
||||||
// This sets up the cache to not need to reload images during
|
// This sets up the cache to not need to reload images during
|
||||||
// download!
|
// download!
|
||||||
// TODO: Re-enable this once we get our change into Chakra
|
// TODO: Re-enable this once we get our change into Chakra
|
||||||
|
|
Loading…
Reference in a new issue