Skip to content

Commit 29c124a

Browse files
authored
Merge pull request #13 from oslabs-beta/rachExportCSSWrapUp
CSS Storage & Export Button Finished
2 parents e0c5734 + 80f4f8f commit 29c124a

File tree

3 files changed

+26
-31
lines changed

3 files changed

+26
-31
lines changed

app/src/components/main/DemoRender.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ const DemoRender = (): JSX.Element => {
2828
const html = `
2929
<html>
3030
<head>
31+
<link
32+
rel="stylesheet"
33+
href="./fake.css"
34+
/>
3135
</head>
3236
<body>
3337
<div id="app">

app/src/components/main/fake.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.test {
2+
color: red !important
3+
}
4+
.MuiBox-root {
5+
color: red
6+
}
7+
css-0 {
8+
color: red
9+
}
10+
11+
#rend1 {
12+
color: red !important
13+
}

app/src/components/right/ExportButton.tsx

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@ export default function ExportButton() {
1515
const state = useSelector((store: RootState) => store.appState);
1616

1717
const genOptions: string[] = [
18-
'Export components',
19-
'Export components with application files'
18+
'Export components'
2019
];
21-
let genOption = 0;
2220

2321
// Closes out the open modal
2422
const closeModal = () => setModal('');
@@ -29,7 +27,7 @@ export default function ExportButton() {
2927
{genOptions.map((option: string, i: number) => (
3028
<ListItem
3129
key={i}
32-
onClick={() => chooseGenOptions(i)}
30+
onClick={() => chooseGenOptions()}
3331
style={{
3432
border: '1px solid #3f51b5',
3533
marginBottom: '2%',
@@ -39,32 +37,19 @@ export default function ExportButton() {
3937
<ListItemText primary={option} style={{ textAlign: 'center' }} />
4038
</ListItem>
4139
))}
42-
<ListItem>
43-
<input type="checkbox" id="tests" name="tests"></input>
44-
<label for="tests">Include Tests</label>
45-
</ListItem>
4640
</List>
4741
);
48-
let testchecked = 0;
49-
// helper function called by showGenerateAppModal
50-
// this function will prompt the user to choose an app directory once they've chosen their export option
51-
const chooseGenOptions = (genOpt: number) => {
52-
// set export option: 0 --> export only components, 1 --> export full project
53-
genOption = genOpt;
54-
55-
//This is exclusive to the electron app
56-
// window.api.chooseAppDir();
57-
// testchecked = document.getElementById('tests').checked;
42+
43+
const chooseGenOptions = () => {
5844
zipFiles(state);
59-
6045
closeModal();
6146
};
6247

6348
setModal(
6449
createModal({
6550
closeModal,
6651
children,
67-
message: 'Choose export preference:',
52+
message: 'Click to download in zip file:',
6853
primBtnLabel: null,
6954
primBtnAction: null,
7055
secBtnAction: null,
@@ -100,17 +85,10 @@ export default function ExportButton() {
10085
);
10186
}
10287

103-
//The below code is exclusive to the Electron App's export function
104-
105-
// import React, { useState, useCallback, useEffect } from 'react';
106-
// import List from '@mui/material/List';
107-
// import ListItem from '@mui/material/ListItem';
108-
// import ListItemText from '@mui/material/ListItemText';
109-
// import GetAppIcon from '@mui/icons-material/GetApp';
110-
// import Button from '@mui/material/Button';
111-
// import exportProject from '../../utils/exportProject.util';
112-
// import createModal from './createModal';
113-
// import { useSelector } from 'react-redux';
88+
//The below code is exclusive to ReacType's Electron App
89+
//If you would like to deploy the app, please comment out the exportButton function above and uncomment the code below
90+
91+
11492
// export default function ExportButton() {
11593
// const [modal, setModal] = useState(null);
11694
// const state = useSelector(store => store.appState)

0 commit comments

Comments
 (0)