Skip to content

Commit

Permalink
Merge pull request #11 from rrigato/dev
Browse files Browse the repository at this point in the history
flexbox to center page
  • Loading branch information
rrigato authored Nov 11, 2023
2 parents ccf1489 + 798f7a1 commit 3080c27
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 10 deletions.
16 changes: 15 additions & 1 deletion static/css/main.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
body {
body, html {
background-color: black;
color: white;
height: 100%;
}

.full-height{
height: 100%;
}

.toggle-container{
align-items: center;
display: flex;
justify-content: center;
height: 80%;
}


2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</head>

<body>
<div id='app-entry-point'></div>
<div id='app-entry-point' class='full-height'></div>
</body>

</html>
4 changes: 2 additions & 2 deletions static/js/App.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import '../css/main.css';
import { HomePageToggle } from './HomePageToggle';
import { HomePageToggle } from './HomePageToggle.jsx';

export function App(){
return(
<div id='app-entry-point'>
<div id='app-component' className='full-height'>
<HomePageToggle/>
</div>
);
Expand Down
10 changes: 7 additions & 3 deletions static/js/HomePageToggle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ import '../css/main.css';

export function HomePageToggle(){
return(
<div id='home-page-toggle-component' className='toggle-container'>
<div id='toggle-0'>
Latest Projects
<div id='home-page-toggle-component' className='full-height'>
<div className='toggle-container'>
<button>Projects</button>
<br/>
<div id='toggle-0'>
Latest Projects
</div>
</div>
</div>
);
Expand Down
8 changes: 5 additions & 3 deletions static/tests/HomePageToggle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { render } from '@testing-library/react';
import { HomePageToggle } from '../js/HomePageToggle.jsx';

describe('Central Content for site', () => {
test('HomePageToggle default render', () => {
test('HomePageToggle default render', async () => {


const {findByText} = render(<HomePageToggle/>);
const {getByRole} = render(<HomePageToggle/>);


findByText(RegExp('Latest Projects'));
const projectButton = await getByRole(
'button', {name: 'Projects'}
);

});
});

0 comments on commit 3080c27

Please sign in to comment.