-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/theNatePi/HackatonProject in…
…to dev
- Loading branch information
Showing
164 changed files
with
13,216 additions
and
37,926 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 @@ | ||
node_modules/* |
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 |
---|---|---|
|
@@ -109,3 +109,4 @@ def get_user_page(username:str, school_id:int): | |
|
||
|
||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,25 +1,23 @@ | ||
import logo from './logo.svg'; | ||
import './App.css'; | ||
import { Routes, Route } from 'react-router-dom' | ||
import SignUpPage from './pages/SignUp'; | ||
import App_profile from './pages/App_profile'; | ||
import { ChakraBaseProvider } from '@chakra-ui/react'; | ||
import {useState} from "react"; | ||
import LoginPage from './pages/Login'; | ||
import "./index.css" | ||
|
||
function App() { | ||
const App = () => { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.js</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
<div> | ||
<ChakraBaseProvider> | ||
<Routes> | ||
<Route index element={<SignUpPage />} /> | ||
<Route path="/SignUp" element={<SignUpPage />} /> | ||
<Route path="/Profile" element={<App_profile />} /> | ||
<Route path="/Login" element={<LoginPage />} /> | ||
</Routes> | ||
</ChakraBaseProvider> | ||
</div> | ||
); | ||
}; | ||
|
||
export default SignUpPage; | ||
export default App; |
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,45 @@ | ||
// SearchPage.js | ||
import React, { useState } from 'react'; | ||
import { Input, Button, Flex, Box, Text } from '@chakra-ui/react'; | ||
import axios from 'axios'; | ||
import {getAPI, postAPI} from './utils/util'; | ||
|
||
const SearchPage = () => { | ||
const [searchText, setSearchText] = useState(''); | ||
const [searchResult, setSearchResult] = useState(null); | ||
const userSchoolID = 1; | ||
|
||
const handleSearch = async () => { | ||
try { | ||
// Replace 'YOUR_API_ENDPOINT' with the actual API endpoint you want to use | ||
const response = await getAPI(`/pages?tag_name=${searchText}&school_id=${userSchoolID}`); | ||
|
||
setSearchResult(response.data); | ||
} catch (error) { | ||
console.error('Error fetching data:', error); | ||
// Handle error as needed | ||
} | ||
}; | ||
|
||
return ( | ||
<Flex direction="column" align="center" mt={8}> | ||
<Input | ||
placeholder="Enter text to search" | ||
value={searchText} | ||
onChange={(e) => setSearchText(e.target.value)} | ||
mb={4} | ||
/> | ||
<Button colorScheme="teal" onClick={handleSearch}> | ||
Search | ||
</Button> | ||
<Flex mt={4} justify="space-around" wrap="wrap"> | ||
{searchResult.map((result) => ( | ||
<text>gi</text> | ||
))} | ||
</Flex> | ||
|
||
</Flex> | ||
); | ||
}; | ||
|
||
export default SearchPage; |
Oops, something went wrong.