Skip to content

Commit 3833b31

Browse files
authored
Merge pull request #11 from oslabs-beta/ted-module
Ted module 2
2 parents ac3ec98 + 75fb379 commit 3833b31

26 files changed

Lines changed: 145 additions & 245 deletions

app/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useState } from 'react';
2-
import Splash from './components/Splash';
2+
import Splash from './components/Splash/Splash';
33
import DashboardContainer from './containers/DashboardContainer';
44
import './stylesheets/scrollBar.scss';
55

app/components/About/About.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import './style.scss';
2+
import './styles.scss';
33
import TeamMembers from './TeamMembers';
44
import PastContributors from './PastContributors';
55
import { useStylingContext } from './StylingContext';

app/components/Contact.tsx

Lines changed: 0 additions & 75 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../../constants.scss';
1+
@import '../../stylesheets/constants.scss';
22

33
.contact {
44
display: flex;

app/components/FirstLaunch/FirstLaunch.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { useContext } from 'react';
22
import { DashboardContext } from '../../context/DashboardContext';
3-
import './FirstLaunch.scss'
3+
import './styles.scss'
44

55
// THIS FILE IS NOT DOING ANYTHING RIGHT NOW
66
const FirstLaunch: React.FC = React.memo(() => {
File renamed without changes.
File renamed without changes.

app/components/Header.tsx

Lines changed: 0 additions & 120 deletions
This file was deleted.

app/components/Header/Header.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import React, { useContext, useState } from 'react';
2+
import { useNavigate } from 'react-router-dom';
3+
import { ApplicationContext } from '../../context/ApplicationContext';
4+
import { DashboardContext } from '../../context/DashboardContext';
5+
import './styles.scss';
6+
import ServiceDropdown from './ServiceDropdown';
7+
import LiveToggle from './LiveToggle';
8+
9+
interface HeaderProps {
10+
app: any; // Consider defining a more specific type if possible
11+
service?: string; // Marking as optional if not all usages of Header need the service
12+
live?: boolean; // Optional boolean for live status
13+
setLive?: React.Dispatch<React.SetStateAction<boolean>>; // Optional function to change live status
14+
}
15+
16+
17+
const Header: React.FC<HeaderProps> = ({ app, service, live, setLive }) => {
18+
const navigate = useNavigate();
19+
const { servicesData } = useContext(ApplicationContext);
20+
const { mode } = useContext(DashboardContext);
21+
const [selectModal, setSelectModal] = useState(false);
22+
const [selectedServices, setSelectedServices] = useState([]);
23+
const toggleDropdown = () => {
24+
setSelectModal(!selectModal);
25+
};
26+
27+
const handleServices = () => {
28+
const path = `/applications/${app}/${selectedServices.join(' ')}`;
29+
navigate(path);
30+
};
31+
32+
return (
33+
<div className="microservice-header">
34+
<h1 className="microserviceTitle">{app}</h1>
35+
<ServiceDropdown
36+
servicesData={servicesData}
37+
selectedServices={selectedServices}
38+
setSelectedServices={setSelectedServices}
39+
isOpen={selectModal}
40+
toggleDropdown={toggleDropdown}
41+
/>
42+
<LiveToggle live={live} toggleLive={() => setLive && setLive(!live)} />
43+
</div>
44+
);
45+
};
46+
47+
export default Header;

0 commit comments

Comments
 (0)