-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from ms-club-sliit/development
Development into Main
- Loading branch information
Showing
23 changed files
with
1,104 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"projects": { | ||
"default": "msclub-admin-panel-dev", | ||
"development": "msclub-admin-panel" | ||
}, | ||
"targets": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:14.18-alpine AS BUILD_IMAGE | ||
RUN apk add --no-cache nodejs npm | ||
WORKDIR /msclub-admin | ||
COPY ["yarn.lock", "package.json", "./"] | ||
RUN yarn install --check-files --non-interactive --ignore-optional --frozen-lockfile | ||
COPY . . | ||
RUN yarn build | ||
|
||
FROM node:14.18-alpine | ||
WORKDIR /app | ||
COPY --from=BUILD_IMAGE /msclub-admin /app/ | ||
EXPOSE 9090 | ||
ENTRYPOINT [ "yarn" ] | ||
CMD [ "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"hosting": { | ||
"public": "build", | ||
"ignore": [ | ||
"firebase.json", | ||
"**/.*", | ||
"**/node_modules/**" | ||
], | ||
"rewrites": [ | ||
{ | ||
"source": "**", | ||
"destination": "/index.html" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import React from "react"; | ||
|
||
const Footer: React.FC = () => ( | ||
<footer className="bg-dark text-center text-white fixed-bottom"> | ||
<div | ||
className="text-center p-3 footer-text" | ||
style={{ backgroundColor: "rgba(0, 0, 0, 0.2)" }} | ||
> | ||
© 2022 Copyright: | ||
<a className="text-white" href="/"> | ||
msclubadmin.com | ||
</a> | ||
</div> | ||
</footer> | ||
); | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import React from 'react'; | ||
import NavBar from "./navbar"; | ||
import Footer from "./footer"; | ||
|
||
// Import and export components in here | ||
export { NavBar, Footer }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
import React, { useState, useEffect } from "react"; | ||
import ApplicationConstants from "../../constants"; | ||
|
||
const NavBar: React.FC = () => { | ||
const [authToken, setAuthToken] = useState<string | null>(); | ||
|
||
useEffect(() => { | ||
let authToken = localStorage.getItem("token"); | ||
|
||
if (authToken) { | ||
setAuthToken(authToken); | ||
} else { | ||
setAuthToken(null); | ||
} | ||
}); | ||
|
||
return ( | ||
<div> | ||
<nav className="navbar fixed-top navbar-expand-lg navbar-dark bg-dark"> | ||
<div className="container-fluid"> | ||
<button | ||
className="navbar-toggler" | ||
type="button" | ||
data-mdb-toggle="collapse" | ||
data-mdb-target="#navbar-content" | ||
aria-controls="navbar-content" | ||
aria-expanded="false" | ||
aria-label="Toggle navigation" | ||
> | ||
<i className="fas fa-bars"></i> | ||
</button> | ||
|
||
<div className="collapse navbar-collapse" id="navbar-content"> | ||
<a className="navbar-brand mt-4 mx-2 mt-lg-0" href="/"> | ||
<img | ||
className="navbar-logo" | ||
src="images/ms_club_logo_light.png" | ||
alt="MS Club Logo" | ||
loading="lazy" | ||
/> | ||
</a> | ||
{authToken ? ( | ||
<ul className="navbar-nav"> | ||
{ApplicationConstants.AUTH_NABAR_ITEMS.map((item) => ( | ||
<li className="navbar-item nav-item" key={item.id}> | ||
<a href={item.link} className="nav-link"> | ||
{item.name} | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
) : ( | ||
<ul className="navbar-nav"> | ||
{ApplicationConstants.DEFAULT_NAVBAR_ITEMS.map((item) => ( | ||
<li className="navbar-item nav-item" key={item.id}> | ||
<a href={item.link} className="nav-link"> | ||
{item.name} | ||
</a> | ||
</li> | ||
))} | ||
</ul> | ||
)} | ||
</div> | ||
|
||
<div className="d-flex align-items-center"> | ||
{authToken ? ( | ||
<a | ||
className="dropdown-toggle d-flex align-items-center hidden-arrow profile-icon" | ||
href="#" | ||
id="profile-dropdown" | ||
role="button" | ||
data-mdb-toggle="dropdown" | ||
aria-expanded="false" | ||
> | ||
<img | ||
src="https://mdbootstrap.com/img/new/avatars/2.jpg" | ||
className="rounded-circle" | ||
height="35" | ||
alt="Black and White Portrait of a Man" | ||
loading="lazy" | ||
/> | ||
</a> | ||
) : null} | ||
<ul | ||
className="dropdown-menu dropdown-menu-end" | ||
aria-labelledby="profile-dropdown" | ||
> | ||
{ApplicationConstants.AUTH_NAVBAR_OPTIONS.map((item) => ( | ||
<li key={item.id}> | ||
{item.link ? ( | ||
<a href={item.link} className="dropdown-item"> | ||
{item.name} | ||
</a> | ||
) : null} | ||
</li> | ||
))} | ||
<li> | ||
<span className="dropdown-item">Logout</span> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</nav> | ||
</div> | ||
); | ||
}; | ||
|
||
export default NavBar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const ApplicationConstants = { | ||
AUTH_NABAR_ITEMS: [ | ||
{ id: 1, name: "Dashboard", link: "/" }, | ||
{ id: 2, name: "Events", link: "/events" }, | ||
{ id: 3, name: "Webinars", link: "/webinars" }, | ||
{ id: 4, name: "Top Speakers", link: "/speakers" }, | ||
{ id: 5, name: "Applications", link: "/applications" }, | ||
{ id: 6, name: "Inquiry", link: "/inquries" }, | ||
], | ||
AUTH_NAVBAR_OPTIONS: [{ id: 1, name: "My Profile", link: "/profile" }], | ||
DEFAULT_NAVBAR_ITEMS: [ | ||
{ id: 1, name: "Sign In", link: "/signin" }, | ||
{ id: 2, name: "Sign Up", link: "/signup" }, | ||
{ id: 3, name: "Contact Admin", link: "/contact" }, | ||
], | ||
}; | ||
|
||
export default ApplicationConstants; |
Oops, something went wrong.