Skip to content

Commit

Permalink
Merge pull request #381 from manipalutsav/feature-showCertificate-navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
abhikpai authored Apr 27, 2024
2 parents 3b54947 + 8455bac commit d94dcbe
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 14 deletions.
10 changes: 8 additions & 2 deletions src/components/Certificates/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export default class Certificates extends React.Component {
college: {},
events: [],
teams: {},
buttonName: "Download All"
buttonName: "Download All",
name:""
};

constructor(props) {
Expand Down Expand Up @@ -128,6 +129,10 @@ export default class Certificates extends React.Component {
<div>
<h2 className="mucapp">Participation Certificates</h2>
</div>
<div>
<input type="search" style={{"padding":".2rem","border":"2px solid grey","borderRadius":"5rem","textAlign":"center","margin":".5rem 0","outline":"none"}} placeholder="Search by Name" value={this.state.name} onChange={(e) => this.setState({ name: e.target.value })} />
</div>

<div className="output">

</div>
Expand All @@ -144,7 +149,8 @@ export default class Certificates extends React.Component {
{
this.state.events.map((event, i) => (
this.state.teams[event].map((team, j) => (
team.members.map((member, k) => (<tr key={`${i}.${j}.${k}`}>
team.members.map((member, k) => (member.name).toLowerCase().includes(this.state.name.toLowerCase()) && (<tr key={`${i}.${j}.${k}`}>
{console.log("member name : "+member.name +"=="+this.state.name+" => " +(member.name).includes(this.state.name))}
<td>{member.registrationID}</td>
<td>{member.name}</td>
<td>{event}</td>
Expand Down
12 changes: 12 additions & 0 deletions src/components/Rounds/Leaderboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export default class extends React.Component {
context.fillText(text, (canvas.width / 6.4), first_start - 40);
// context.fillRect((canvas.width / 3.1), first_start + 43, width, 2);
}
if (i == 3) {
context.fillText(text, (canvas.width / 6.4), first_start + 80);
// context.fillRect((canvas.width / 3.1), first_start + 43, width, 2);
}
}
for (let i = 0; i < placesArray[1].length; i++) {
context.font = "bold 34px HammersmithOne";
Expand All @@ -119,6 +123,10 @@ export default class extends React.Component {
context.fillText(text, (canvas.width / 6.4), second_start - 40);
// context.fillRect((canvas.width / 3.1), second_start + 43, width, 2);
}
if (i == 3) {
context.fillText(text, (canvas.width / 6.4), second_start + 80);
// context.fillRect((canvas.width / 3.1), second_start + 43, width, 2);
}
}
for (let i = 0; i < placesArray[2].length; i++) {
let text = placesArray[2][i]["name"];
Expand All @@ -135,6 +143,10 @@ export default class extends React.Component {
context.fillText(text, (canvas.width / 6.4), third_start - 40);
// context.fillRect((canvas.width / 3.1), third_start + 43, width, 2);
}
if (i == 3) {
context.fillText(text, (canvas.width / 6.4), third_start + 80);
// context.fillRect((canvas.width / 3.1), third_start + 43, width, 2);
}
}

canvas.toBlob(async (blob) => {
Expand Down
12 changes: 6 additions & 6 deletions src/components/Volunteer/CoreVolunteer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getColleges } from "../../services/collegeServices";
import { toast } from "../../actions/toastActions";
import { Link } from "gatsby";

import certificateURL from "../../images/volunteer-certificate-core.jpg";
import certificateURL from "../../images/volunteer-certificate-core.png";
import JSZip from "jszip";
const sizes = [
{ value: "XS", label: "Extra Small" },
Expand Down Expand Up @@ -63,9 +63,9 @@ class CoreVolunteer extends React.Component {
canvas.height = image.height;
context.drawImage(image, 0, 0);
context.font = "bold 71px Blogger Sans";
context.fillStyle = "#fff4e4";
context.fillStyle = "#000000";
context.textAlign = "center";
context.fillText(list[i].name, canvas.width / 2, 480);
context.fillText(list[i].name, canvas.width / 2, 725);
context.font = "bold 60px Blogger Sans";

// Breaking the lines if it is too big to fit
Expand Down Expand Up @@ -95,7 +95,7 @@ class CoreVolunteer extends React.Component {
);
});
} else {
context.fillText(list[i].college, canvas.width / 2, 820);
context.fillText(list[i].college, canvas.width / 2, 1050);
}
canvas.toBlob((blob) => {
this.setState({
Expand Down Expand Up @@ -205,9 +205,9 @@ class CoreVolunteer extends React.Component {
<div>
<div>
<h2 className="mucapp">Core Volunteers</h2>
{/* <button className="mucapp" onClick={this.downloadAll}>
<button className="mucapp" onClick={this.downloadAll}>
{this.state.downloadButtonName}
</button> */}
</button>
</div>
</div>
<div className="coreVolunteers">
Expand Down
12 changes: 6 additions & 6 deletions src/components/Volunteer/Volunteer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Link } from "gatsby";
import { keyToDisplay } from "../../utils/common";
import Block from "../../commons/Block";

import certificateURL from "../../images/volunteer-certificate-event.jpg";
import certificateURL from "../../images/volunteer-certificate-event.png";
import JSZip from "jszip";

const sizes = [
Expand Down Expand Up @@ -63,9 +63,9 @@ class Volunteer extends React.Component {
canvas.height = image.height;
context.drawImage(image, 0, 0);
context.font = "bold 71px Blogger Sans";
context.fillStyle = "#fff4e4";
context.fillStyle = "#000000";
context.textAlign = "center";
context.fillText(list[i].name, canvas.width / 2, 480);
context.fillText(list[i].name, canvas.width / 2, 725);
context.font = "bold 60px Blogger Sans";

// Breaking the lines if it is too big to fit
Expand Down Expand Up @@ -95,7 +95,7 @@ class Volunteer extends React.Component {
);
});
} else {
context.fillText(list[i].college, canvas.width / 2, 820);
context.fillText(list[i].college, canvas.width / 2, 1050);
}
canvas.toBlob((blob) => {
this.setState({
Expand Down Expand Up @@ -211,11 +211,11 @@ class Volunteer extends React.Component {
<h2 className="mucapp">
{keyToDisplay(this.props.type)} Volunteers
</h2>
{/* {this.props.type == "event" && (
{this.props.type == "event" && (
<button className="mucapp" onClick={this.downloadAll}>
{this.state.downloadButtonName}
</button>
)} */}
)}
</div>
</div>
<div className="coreVolunteers">
Expand Down
Binary file removed src/images/volunteer-certificate-core.jpg
Binary file not shown.
Binary file added src/images/volunteer-certificate-core.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed src/images/volunteer-certificate-event.jpg
Binary file not shown.
Binary file added src/images/volunteer-certificate-event.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/pages/publicboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ export default class extends React.Component {
}
componentWillMount() {
this.init();

//just testing delete this block before pushing

leaderboardService.getPublic().then(lb =>
this.setState({
leaderboard: lb.sort((a, b) => parseFloat(b.points) - parseFloat(a.points)),
})
);
console.log(this.leaderboard,"leaderboard");
//block ends here
}
async init() {
await this.setState({ status: "Fetching events..." });
Expand Down

0 comments on commit d94dcbe

Please sign in to comment.