Skip to content

Commit 378e211

Browse files
Merge pull request #94 from TreeHacks/treehacks-2023
updates
2 parents 5f0ea98 + 1c9eb08 commit 378e211

51 files changed

Lines changed: 710 additions & 301 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"gsap": "^2.0.2",
6060
"html-webpack-plugin": "2.29.0",
6161
"jest": "20.0.4",
62-
"node-sass": "^4.13.1",
62+
"node-sass": "^4.14.1",
6363
"object-assign": "4.1.1",
6464
"path": "^0.12.7",
6565
"postcss-flexbugs-fixes": "3.2.0",
@@ -72,6 +72,7 @@
7272
"react-dom": "^16.12.0",
7373
"react-emojione": "^5.0.1",
7474
"react-player": "^1.6.4",
75+
"react-responsive-masonry": "^2.1.7",
7576
"react-router": "^4.3.1",
7677
"react-router-dom": "^4.3.1",
7778
"react-textfit": "^1.1.0",

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Projects from "./js/projects.jsx";
99
import Hackpacks from "./js/hackpacks.jsx";
1010
import RoomStatus from "./js/room-status.jsx";
1111
import Apis from "./js/apis/Apis.jsx";
12+
1213
import Challenge from "./js/challenge.jsx";
1314
import "./favicons/favicons";
1415
import "./index.scss";

src/js/apis/Apis.jsx

Lines changed: 67 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
import React, { useEffect, useState } from "react";
22
import Bricklayer from "bricklayer";
33
import data from "./data.yaml";
4+
import Masonry, { ResponsiveMasonry } from "react-responsive-masonry";
45

56
export default class extends React.Component {
67
constructor(props) {
78
super(props);
8-
this.myRef = React.createRef();
99
this.state = {
1010
tag: null,
1111
searchInput: "",
1212
companyData: data.companies,
13+
constantCompanyData: data.companies,
1314
};
14-
this.onTagClick = this.onTagClick.bind(this);
1515
this.handleChange = this.handleChange.bind(this);
1616
}
1717

1818
handleChange = (e) => {
1919
e.preventDefault();
2020
this.setState({ searchInput: e.target.value });
2121
//const dataC = [{ name: "Belgium", continent: "Europe" }];
22-
if (this.state.searchInput.length > 0) {
23-
const filtered = this.state.companyData.filter(
22+
if (this.state.searchInput.length == 0) {
23+
this.setState({ companyData: this.state.constantCompanyData });
24+
} else if (this.state.searchInput.length > 0) {
25+
const filtered = this.state.constantCompanyData.filter(
2426
(country) =>
2527
country.apis[0].title
2628
.toLowerCase()
@@ -45,23 +47,6 @@ export default class extends React.Component {
4547
project.submitLastName?.includes(search)
4648
);*/
4749

48-
componentDidMount() {
49-
this.bricklayer = new Bricklayer(this.myRef.current);
50-
}
51-
onTagClick(tag) {
52-
this.bricklayer.destroy();
53-
54-
if (tag == this.state.tag) {
55-
this.setState({ tag: null }, () => {
56-
this.bricklayer = new Bricklayer(this.myRef.current);
57-
});
58-
} else {
59-
this.setState({ tag: tag }, () => {
60-
this.bricklayer = new Bricklayer(this.myRef.current);
61-
});
62-
}
63-
}
64-
6550
render() {
6651
return (
6752
<div class="apis container">
@@ -80,20 +65,22 @@ export default class extends React.Component {
8065
Here you can find a list of all the API's offered by our sponsoring
8166
companies, along with any resources and forms we post to receive cloud
8267
credits.
83-
{/* <input
68+
<input
8469
type="text"
8570
placeholder="Search here"
71+
id="searchInput"
8672
style={{
8773
width: "80%",
8874
borderRadius: "20px",
75+
fontSize: "20px",
8976
backgroundColor: "transparent",
9077
border: "1px solid black",
9178
padding: "10px 15px",
9279
margin: "20px 0",
9380
}}
9481
onChange={this.handleChange}
9582
value={this.state.searchInput}
96-
/> */}
83+
/>
9784
{/* {(data.tags || []).map((tag) => (
9885
<button
9986
className={`api-tag-button ${
@@ -105,41 +92,64 @@ export default class extends React.Component {
10592
</button>
10693
))} */}
10794
</div>
108-
<div className="bricklayer" ref={this.myRef}>
109-
{this.state.companyData.map((company) =>
110-
company.apis.map((api) => {
111-
if (
112-
this.state.tag == null ||
113-
(api.tags && api.tags.includes(this.state.tag))
114-
) {
115-
return (
116-
<div className="api-item-container">
117-
<div className="card api-item" key={api.title}>
118-
<h3>{api.title}</h3>
119-
<p>{api.description}</p>
120-
{company.slack && (
121-
<p>
122-
slack: <strong>#{company.slack}</strong>
123-
</p>
124-
)}
125-
{console.log(api)}
126-
{api.links != null &&
127-
api.links.map((link) => (
128-
<a target="_blank" href={link.url}>
129-
<button className="main-button">
130-
{link.title || link.url}
131-
</button>
132-
</a>
133-
))}
95+
<ResponsiveMasonry columnsCountBreakPoints={{ 350: 1, 750: 2, 900: 3 }}>
96+
<Masonry>
97+
{this.state.companyData.map((company) =>
98+
company.apis.map((api) => {
99+
if (
100+
this.state.tag == null ||
101+
(api.tags && api.tags.includes(this.state.tag))
102+
) {
103+
return (
104+
<div className="api-item-container">
105+
<div className="card api-item" key={api.title}>
106+
<h3>{api.title}</h3>
107+
<p>{api.description}</p>
108+
{company.slack && (
109+
<p>
110+
slack: <strong>#{company.slack}</strong>
111+
</p>
112+
)}
113+
{console.log(api)}
114+
{api.links != null &&
115+
api.links.map((link) => (
116+
<a target="_blank" href={link.url}>
117+
<button className="main-button">
118+
{link.title || link.url}
119+
</button>
120+
</a>
121+
))}
122+
</div>
134123
</div>
135-
</div>
136-
);
137-
} else {
138-
return null;
139-
}
140-
})
141-
)}
142-
</div>
124+
);
125+
} else {
126+
return null;
127+
}
128+
})
129+
)}
130+
{this.state.companyData.length == 0 && (
131+
<div
132+
style={{
133+
justifyContent: "center",
134+
display: "flex",
135+
flexDirection: "column",
136+
alignContent: "center",
137+
alignItems: "center",
138+
}}
139+
>
140+
<h1
141+
style={{
142+
color: "black",
143+
paddingBottom: "30px",
144+
}}
145+
>
146+
No results found
147+
</h1>
148+
</div>
149+
)}
150+
</Masonry>
151+
</ResponsiveMasonry>
152+
<div></div>
143153
</div>
144154
);
145155
}

src/js/apis/data.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ companies:
104104
url: https://docs.mem.ai/
105105
tags:
106106
- Geospatial
107-
- company: Mem
107+
- company: Convex
108108
apis:
109109
- title: Convex API
110110
description: Convex platform getting started, usage docs, and reference APIs
@@ -113,3 +113,12 @@ companies:
113113
url: https://docs.convex.dev/tutorial
114114
tags:
115115
- Geospatial
116+
- company: Algolia
117+
apis:
118+
- title: Algolia API
119+
description: Algolia has set up the "1 month free" for TreeHacks 2023 hackers, hackers can redeem it at https://algolia.com/redeem using the code TREEHACKS23
120+
links:
121+
- title: Redeem here
122+
url: https://algolia.com/redeem
123+
tags:
124+
- Geospatial

src/js/event-schedule.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default Vue.component("event-schedule", {
2929
</div>
3030
</div>
3131
</div>
32+
3233
<div class="schedule-category-view" v-if="query.length > 0 || selectedCat != -1">
34+
35+
3336
<div class="section-wrapper">
3437
<div class="content-wrapper-wide">
3538
<div class="schedule-category-view-inner">
@@ -41,10 +44,14 @@ export default Vue.component("event-schedule", {
4144
<div v-if="item.description" v-html="item.description" />
4245
<span class="schedule-category-view-item-circle" :style="{background: item.color}"></span>
4346
</div>
47+
<div v-if="categoryItems.length == 0" class="schedule-category-view-item">
48+
Coming soon! We are still finalizing the incredible lineup and schedule for these events!
49+
</div>
4450
</div>
4551
</div>
4652
</div>
4753
</div>
54+
4855
<div ref="wrapper" v-if="query.length == 0 && selectedCat == -1" class="schedule-wrapper" @scroll="handleScroll" @click="hidePopup">
4956
<div class="schedule-inner" :style="{height: scheduleHeight, width: visibleHours * hourWidth + 'px'}">
5057
<div v-for="i in visibleHours" class="schedule-marker" :style="{left: (i - 1) * hourWidth + 'px'}">
@@ -131,6 +138,11 @@ export default Vue.component("event-schedule", {
131138
color: "#E51B5D",
132139
items: [],
133140
},
141+
{
142+
name: "Food",
143+
color: "#0089B6",
144+
items: [],
145+
},
134146
{
135147
name: "Special Talks / Events",
136148
color: "#513ec3",
@@ -495,15 +507,15 @@ export default Vue.component("event-schedule", {
495507
// this.calendar.download("treeHacksSchedule2021")
496508
// }
497509
if (this.selectedCat === 0) {
498-
this.calendar0.download("mainEvents2021");
510+
this.calendar0.download("mainEvents2023");
499511
} else if (this.selectedCat === 1) {
500-
this.calendar1.download("hackX2021");
512+
this.calendar1.download("hackX2023");
501513
} else if (this.selectedCat === 2) {
502-
this.calendar2.download("workshops2021");
514+
this.calendar2.download("workshops2023");
503515
} else if (this.selectedCat === 3) {
504-
this.calendar3.download("officeHours2021");
516+
this.calendar3.download("officeHours2023");
505517
} else {
506-
this.calendar.download("treeHacksSchedule2021");
518+
this.calendar.download("treeHacksSchedule2023");
507519
}
508520
},
509521
hidePopup: function (e) {

src/js/prizeData.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)