Skip to content

Commit 61b4f6f

Browse files
committed
redoing changes
1 parent 4304d7c commit 61b4f6f

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

app/components/Splash.jsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import React, { useEffect } from 'react';
2+
3+
4+
const Splash = (props) => {
5+
const { toggleSplash } = props;
6+
useEffect(() => { setTimeout(() => toggleSplash(false), 3000); });
7+
8+
return (
9+
<div id="splash">
10+
<img alt="Chronos Logo" src="app/assets//icons/icon.png" id="splashLogo" />
11+
<span id="splashText">chronos</span>
12+
</div>
13+
);
14+
};
15+
16+
export default Splash;

app/index.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
body {
22
background-color: #333;
33
background: rgb(25,0,36);
4-
background: linear-gradient(135deg, rgba(25,0,36,1) 0%, rgb(68, 68, 68) 0%, rgb(29, 29, 29) 100%);
4+
background: linear-gradient(135deg, rgba(25,0,36,1) 0%, rgb(68, 68, 68) 0%, rgb(29, 29, 29) 100%);
55
}
66

77
img {
88
margin-bottom: -75px;
99
}
1010

11+
#splash {
12+
13+
}
14+
1115
.header {
1216
color: white;
1317
height: 50px;

app/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
import React, { useContext } from 'react';
1+
import React, { useContext, useState } from 'react';
22
import ReactDOM from 'react-dom';
33
import SetupContext from './context/SetupContext.js';
44
import './index.css';
5-
import AddService from './components/AddService.jsx'
5+
import AddService from './components/AddService.jsx';
66
import ServiceDashboard from './components/ServicesDashboard.jsx';
7+
import Splash from './components/Splash.jsx';
78

89
const App = () => {
10+
const [splash, toggleSplash] = useState(true);
911
const chronosSetup = useContext(SetupContext);
12+
13+
if (splash) return <Splash toggleSplash={toggleSplash} />;
1014
return chronosSetup.setupRequired ? <AddService /> : <ServiceDashboard />;
1115
};
1216

0 commit comments

Comments
 (0)