Skip to content

Commit 2170efc

Browse files
Merge pull request #1 from mcode/login-basics
add login page connected to keycloak
2 parents 7a22dce + a841d2a commit 2170efc

11 files changed

Lines changed: 1082 additions & 16 deletions

File tree

package-lock.json

Lines changed: 880 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,26 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"@emotion/react": "^11.10.5",
7+
"@emotion/styled": "^11.10.5",
8+
"@mui/icons-material": "^5.10.9",
9+
"@mui/material": "^5.10.12",
610
"@testing-library/jest-dom": "^5.16.5",
711
"@testing-library/react": "^13.4.0",
812
"@testing-library/user-event": "^13.5.0",
913
"@types/jest": "^27.5.2",
1014
"@types/node": "^16.18.2",
1115
"@types/react": "^18.0.23",
1216
"@types/react-dom": "^18.0.7",
17+
"axios": "^1.1.3",
1318
"react": "^18.2.0",
1419
"react-dom": "^18.2.0",
1520
"react-scripts": "5.0.1",
1621
"typescript": "^4.8.4",
1722
"web-vitals": "^2.1.4"
1823
},
1924
"scripts": {
20-
"start": "react-scripts start",
25+
"start": "PORT=3006 react-scripts start",
2126
"build": "react-scripts build",
2227
"test": "react-scripts test",
2328
"eject": "react-scripts eject"

src/App.tsx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
import React from 'react';
2-
import logo from './logo.svg';
32
import './App.css';
3+
import Login from './views/Login/Login';
4+
import { ThemeProvider } from '@mui/material/styles';
5+
import theme from './styles/theme'
46

57
function App() {
68
return (
9+
710
<div className="App">
8-
<header className="App-header">
9-
<img src={logo} className="App-logo" alt="logo" />
10-
<p>
11-
Edit <code>src/App.tsx</code> and save to reload.
12-
</p>
13-
<a
14-
className="App-link"
15-
href="https://reactjs.org"
16-
target="_blank"
17-
rel="noopener noreferrer"
18-
>
19-
Learn React!
20-
</a>
21-
</header>
11+
<ThemeProvider theme={theme}>
12+
<Login />
13+
</ThemeProvider>
2214
</div>
2315
);
2416
}

src/config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"realm": "ClientFhirServer",
3+
"client": "pims-login",
4+
"auth": "http://localhost:8180/auth",
5+
"scopeId": "pims"
6+
7+
}
8+

src/styles/theme.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import { createTheme } from '@mui/material/styles';
2+
const colors = {
3+
white: '#fff',
4+
black: '#222',
5+
red: '#d95d77',
6+
redLight: '#f50057',
7+
blue: '#5d89a1',
8+
green: '#28a745',
9+
gray: '#4a4a4a',
10+
grayLight: '#4e5258',
11+
grayLighter: '#b5b6ba',
12+
grayLightest: '#f2f3f9',
13+
};
14+
15+
const paletteBase = {
16+
primary: {
17+
main: colors.blue
18+
},
19+
secondary: {
20+
main: colors.redLight,
21+
success: colors.green
22+
},
23+
error: {
24+
main: colors.red
25+
},
26+
common: colors,
27+
background: {
28+
default: colors.grayLightest,
29+
primary: colors.grayLight
30+
},
31+
text: {
32+
primary: colors.black,
33+
secondary: colors.black,
34+
gray: colors.grayLighter
35+
},
36+
};
37+
38+
const theme = createTheme({
39+
palette: { ...paletteBase },
40+
});
41+
42+
export default theme;

src/views/DoctorOrders/DoctorOrders.css

Whitespace-only changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import { render, screen } from '@testing-library/react';
3+
import DoctorOrders from './DoctorOrders';
4+
5+
test('renders learn react link', () => {
6+
render(<DoctorOrders />);
7+
const linkElement = screen.getByText(/learn react/i);
8+
expect(linkElement).toBeInTheDocument();
9+
});
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import React from 'react';
2+
import './DoctorOrders.css';
3+
4+
function DoctorOrders() {
5+
return (
6+
<div className="DoctorOrders">
7+
<h1>Doctor Orders</h1>
8+
</div>
9+
);
10+
}
11+
12+
export default DoctorOrders;

src/views/Login/Login.css

Whitespace-only changes.

src/views/Login/Login.test.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react';
2+
import { render, screen } from '@testing-library/react';
3+
import Login from './Login';
4+
5+
test('renders learn react link', () => {
6+
render(<Login />);
7+
const linkElement = screen.getByText(/learn react/i);
8+
expect(linkElement).toBeInTheDocument();
9+
});

0 commit comments

Comments
 (0)