Skip to content

Commit

Permalink
delete redundant route, return Django admin, change route for UI admi…
Browse files Browse the repository at this point in the history
…n page
  • Loading branch information
BelousSofiya committed Nov 22, 2023
1 parent 6b08dcc commit eff65e3
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 21 deletions.
6 changes: 3 additions & 3 deletions FrontEnd/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import AdminPage from './components/adminPage/AdminPage';
import BasicPage from './components/basicPage/BasicPage';
import { AuthContext } from './context';
import { useProvideAuth } from './hooks';
import { Search } from './components/SearchPage/Search';
// import { Search } from './components/SearchPage/Search';

function App() {
const auth = useProvideAuth();
Expand All @@ -16,8 +16,8 @@ function App() {
<div className="App">
<Routes>
<Route path="/*" element={<BasicPage />} />
<Route path="/admin/*" element={<AdminPage />} />
<Route path="/search" element={<Search isAuthorized={auth} />} />
<Route path="/customadmin/*" element={<AdminPage />} />
{/* <Route path="/search" element={<Search isAuthorized={auth} />} /> */}
</Routes>
</div>
</BrowserRouter>
Expand Down
54 changes: 42 additions & 12 deletions FrontEnd/src/components/basicPage/BasicPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,32 +63,62 @@ function BasicPage() {
>
<Header isAuthorized={auth.isAuth} />
<Routes>
<Route path="/" element={<MainPage isAuthorized={auth.isAuth}/>} />
<Route path="/" element={<MainPage isAuthorized={auth.isAuth} />} />
<Route path="/profile/*" element={<ProfilePage />} />
<Route path="/profile-detail/:id" element={<ProfileDetailPage isAuthorized={auth.isAuth}/>}/>
<Route path="/profiles/:filter" element={<ProfileListPage isAuthorized={auth.isAuth} />}/>
<Route
path="/profile-detail/:id"
element={<ProfileDetailPage isAuthorized={auth.isAuth} />}
/>
<Route
path="/profiles/:filter"
element={<ProfileListPage isAuthorized={auth.isAuth} />}
/>
{auth.isAuth ? (
<Route path="/login" element={<Navigate to="/profile/user-info" />} />
) : (
<Route path="/login" element={<AuthorizationPage />} />
)}
{auth.isAuth ? (
<Route path="/sign-up" element={<Navigate to="/profile/user-info" />} />
<Route
path="/sign-up"
element={<Navigate to="/profile/user-info" />}
/>
) : (
<Route path="/sign-up" element={<SignUpPage />} />
)}
<Route path="/sign-up/modal" element={<SignUpModalPage />} />
<Route path="/sign-up/resend-activation" element={<ResendActivationPage />} />
<Route path="/activate/:uid/:token" element={<ActivationProfilePage />} />
<Route path="/reset-password" element={<SendEmailRestorePasswordPage />} />
<Route path="/reset-password/modal" element={<RestorePasswordModalPage />} />
<Route path="/password/reset/confirm/:uid/:token" element={<RestorePasswordPage />} />
<Route path="/reset-password/successfully" element={<RestorePasswordSuccessPage />} />
<Route path="/reset-password/failed" element={<RestorePasswordFailedPage />} />
<Route
path="/sign-up/resend-activation"
element={<ResendActivationPage />}
/>
<Route
path="/activate/:uid/:token"
element={<ActivationProfilePage />}
/>
<Route
path="/reset-password"
element={<SendEmailRestorePasswordPage />}
/>
<Route
path="/reset-password/modal"
element={<RestorePasswordModalPage />}
/>
<Route
path="/password/reset/confirm/:uid/:token"
element={<RestorePasswordPage />}
/>
<Route
path="/reset-password/successfully"
element={<RestorePasswordSuccessPage />}
/>
<Route
path="/reset-password/failed"
element={<RestorePasswordFailedPage />}
/>
<Route path="/privacy-policy" element={<PrivacyPolicy />} />
<Route path="/terms-and-conditions" element={<TermsAndConditions />} />
<Route path="/cookies-policy" element={<CookiesPolicyComponent />} />
<Route path="/search" element={<Search isAuthorized={auth.isAuth} />} />
<Route path="/search" element={<Search isAuthorized={auth} />} />
</Routes>
<Footer />
<ScrollToTopButton />
Expand Down
12 changes: 6 additions & 6 deletions configs/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ server {
}

# Django Admin
#location /admin/ {
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header Host $host;
#proxy_pass http://api-dev:8000/admin/;
#proxy_redirect off;
#}
location /admin/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://api-dev:8000/admin/;
proxy_redirect off;
}

# PGAdmin
location /pgadmin/ {
Expand Down

0 comments on commit eff65e3

Please sign in to comment.