Skip to content

Commit ecb5384

Browse files
committed
Misc CSS and transition fixes
1 parent df5de4b commit ecb5384

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

resources/scripts/TransitionRouter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default ({ children }: Props) => (
1010
<Route
1111
render={({ location }) => (
1212
<TransitionGroup className={'route-transition-group'}>
13-
<CSSTransition key={location.key} timeout={250} classNames={'fade'}>
13+
<CSSTransition key={location.key} timeout={250} in={true} appear={true} classNames={'fade'}>
1414
<section>
1515
{children}
1616
<div className={'mx-auto w-full'} style={{ maxWidth: '1200px' }}>

resources/scripts/routers/ServerRouter.tsx

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import WebsocketHandler from '@/components/server/WebsocketHandler';
88
import { ServerContext } from '@/state/server';
99
import { Provider } from 'react-redux';
1010
import DatabasesContainer from '@/components/server/databases/DatabasesContainer';
11+
import FileManagerContainer from '@/components/server/files/FileManagerContainer';
12+
import { CSSTransition } from 'react-transition-group';
1113

1214
const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>) => {
1315
const server = ServerContext.useStoreState(state => state.server.data);
@@ -23,16 +25,18 @@ const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>)
2325
return (
2426
<React.Fragment>
2527
<NavigationBar/>
26-
<div id={'sub-navigation'}>
27-
<div className={'mx-auto'} style={{ maxWidth: '1200px' }}>
28-
<div className={'items'}>
29-
<NavLink to={`${match.url}`} exact>Console</NavLink>
30-
<NavLink to={`${match.url}/files`}>File Manager</NavLink>
31-
<NavLink to={`${match.url}/databases`}>Databases</NavLink>
32-
<NavLink to={`${match.url}/users`}>User Management</NavLink>
28+
<CSSTransition timeout={250} classNames={'fade'} appear={true} in={true}>
29+
<div id={'sub-navigation'}>
30+
<div className={'mx-auto'} style={{ maxWidth: '1200px' }}>
31+
<div className={'items'}>
32+
<NavLink to={`${match.url}`} exact>Console</NavLink>
33+
<NavLink to={`${match.url}/files`}>File Manager</NavLink>
34+
<NavLink to={`${match.url}/databases`}>Databases</NavLink>
35+
<NavLink to={`${match.url}/users`}>User Management</NavLink>
36+
</div>
3337
</div>
3438
</div>
35-
</div>
39+
</CSSTransition>
3640
<Provider store={ServerContext.useStore()}>
3741
<TransitionRouter>
3842
<div className={'w-full mx-auto'} style={{ maxWidth: '1200px' }}>
@@ -45,6 +49,7 @@ const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>)
4549
<WebsocketHandler/>
4650
<Switch location={location}>
4751
<Route path={`${match.path}`} component={ServerConsole} exact/>
52+
<Route path={`${match.path}/files`} component={FileManagerContainer} exact/>
4853
<Route path={`${match.path}/databases`} component={DatabasesContainer}/>
4954
</Switch>
5055
</React.Fragment>

resources/scripts/state/flashes.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { FlashMessageType } from '@/components/MessageBox';
44
export interface FlashStore {
55
items: FlashMessage[];
66
addFlash: Action<FlashStore, FlashMessage>;
7+
addError: Action<FlashStore, { message: string; key?: string }>;
78
clearFlashes: Action<FlashStore, string | void>;
89
}
910

@@ -20,6 +21,9 @@ const flashes: FlashStore = {
2021
addFlash: action((state, payload) => {
2122
state.items.push(payload);
2223
}),
24+
addError: action((state, payload) => {
25+
state.items.push({ type: 'error', title: 'Error', ...payload });
26+
}),
2327
clearFlashes: action((state, payload) => {
2428
state.items = payload ? state.items.filter(flashes => flashes.key !== payload) : [];
2529
}),

resources/styles/components/animations.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*! purgecss start ignore */
2-
.fade-enter {
2+
.fade-enter, .fade-appear {
33
@apply .opacity-0;
44
}
55

6-
.fade-enter-active {
6+
.fade-enter-active, .fade-appear-active {
77
@apply .opacity-100;
88
transition: opacity 250ms;
99
}

resources/styles/components/spinners.css

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,14 @@
7474
}
7575

7676
&.spinner-blue {
77-
border: 3px solid hsla(212, 92%, 43%, 0.2);
77+
border-style: solid;
78+
border-color: hsla(212, 92%, 43%, 0.2);
7879
border-top-color: hsl(212, 92%, 43%);
7980
}
8081

8182
&.spinner-white {
82-
border: 3px solid rgba(255, 255, 255, 0.2);
83+
border-style: solid;
84+
border-color: rgba(255, 255, 255, 0.2);
8385
border-top-color: rgb(255, 255, 255);
8486
}
8587
}

0 commit comments

Comments
 (0)