Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/theNatePi/HackatonProject in…
Browse files Browse the repository at this point in the history
…to dev
  • Loading branch information
Kyle committed Jan 28, 2024
2 parents 18c6809 + bbb825e commit a71696a
Show file tree
Hide file tree
Showing 164 changed files with 13,216 additions and 37,926 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/*
1 change: 1 addition & 0 deletions backend/endpoints/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,4 @@ def get_user_page(username:str, school_id:int):




381 changes: 374 additions & 7 deletions frontend/package-lock.json

Large diffs are not rendered by default.

23 changes: 19 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,32 @@
"private": true,
"dependencies": {
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@chakra-ui/react": "^2.8.2",
"@editorjs/editorjs": "^2.29.0",
"@editorjs/header": "^2.8.1",
"@editorjs/list": "^1.9.0",
"@editorjs/paragraph": "^2.11.3",
"@editorjs/raw": "^2.5.0",
"@editorjs/simple-image": "^1.6.0",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.6.7",
"framer-motion": "^11.0.3",
"framer-motion": "^11.0.3",
"interact": "^0.0.3",
"interactjs": "^1.10.26",
"localforage": "^1.10.0",
"lodash": "^4.17.21",
"match-sorter": "^6.3.3",
"mdb-react-ui-kit": "^7.1.0",
"normalize.css": "^8.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-editor-js": "^2.1.0",
"react-router-dom": "^6.21.3",
"react-scripts": "^5.0.1",
"sort-by": "^1.2.0",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand All @@ -43,5 +55,8 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11"
}
}
3 changes: 2 additions & 1 deletion frontend/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
background: linear-gradient(to right bottom, rgba(246, 211, 101, 1), rgba(253, 160, 133, 1))
}
}

38 changes: 18 additions & 20 deletions frontend/src/App.js
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;
45 changes: 45 additions & 0 deletions frontend/src/SearchPage.js
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;
Loading

0 comments on commit a71696a

Please sign in to comment.