Skip to content

Instantly share code, notes, and snippets.

View sabesansathananthan's full-sized avatar
:octocat:
Work

Sathananthan Sabesan sabesansathananthan

:octocat:
Work
View GitHub Profile
@sabesansathananthan
sabesansathananthan / CountryPicker.jsx
Created June 16, 2020 18:09
Create a COVID-19 Tracker using React.js
import React, { useState, useEffect } from "react";
import { NativeSelect, FormControl } from "@material-ui/core";
import styles from "./CountryPicker.module.css";
import { fetchCountries } from "../../api";
const CountryPicker = ({ handleCountryChange }) => {
const [fetchedCountries, setFetchedCountries] = useState([]);
useEffect(() => {
const fetchAPI = async () => {
setFetchedCountries(await fetchCountries());
@sabesansathananthan
sabesansathananthan / CountryPicker.module.css
Created June 16, 2020 18:14
Create a COVID-19 Tracker using React.js
.formControl {
width: 30%;
margin-bottom: 30px !important;
}
@sabesansathananthan
sabesansathananthan / index.js
Created June 16, 2020 19:33
Components folder index file for Create a COVID-19 Tracker using React.js
export { default as Cards } from "./Cards/Cards";
export { default as Chart } from "./Chart/Chart";
export { default as CountryPicker } from "./CountryPicker/CountryPicker";
@sabesansathananthan
sabesansathananthan / App.js
Created June 16, 2020 19:42
Create a COVID-19 Tracker using React.js
import React from "react";
import { Cards, Chart, CountryPicker } from "./Components";
import styles from "./App.module.css";
import { fetchData } from "./api";
import coronaImage from "./images/image.png";
class App extends React.Component {
state = {
data: {},
country: "",
@sabesansathananthan
sabesansathananthan / App.module.css
Created June 16, 2020 19:59
Create a COVID-19 Tracker using React.js
body {
background-color: rgb(250, 250, 250);
}
.container {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
@sabesansathananthan
sabesansathananthan / README.md
Last active December 15, 2022 06:23
Beautify Your GitHub Profile README

Hi there, I'm Sabesan Sathananthan - aka [Sabesan][website] 👋

I'm a Student, Undergraduate, Developer, and Physics Teacher!

  • 🔭 I’m currently working on a my final year project!
  • 🌱 I’m currently learning Fullstack and Machine Learning
  • 👯 I’m looking to collaborate with other content creators
  • 🥅 2020 Goals: Contribute more to Open Source projects
  • ⚡ Fun fact: I love to play chess and listen music.
name: Latest blog post workflow
on:
schedule:
# Runs every hour
- cron: "0 * * * *"
workflow_dispatch:
jobs:
update-readme-with-blog:
name: Update this repo's README with latest blog posts
@sabesansathananthan
sabesansathananthan / Slider.js
Last active August 17, 2020 19:17
Embed Dev.to as a blog on your React Website
import React from "react";
import { Col, Row } from "shards-react";
import BlogCard from "./BlogCard";
// wrapper for items
class Slider extends React.Component {
constructor(props) {
super(props);
this.state = { itemRows: [], avatar: "", profileLink: "" };
}
@sabesansathananthan
sabesansathananthan / BlogCard.js
Created August 17, 2020 18:40
Embed Dev.to as a blog on your React Website
import React from "react";
import { Card, CardBody, CardFooter } from "shards-react";
import ShortenText from "../utils/ShortenText";
import ToText from "../utils/ToText";
import { faUser, faCalendarAlt } from "@fortawesome/free-solid-svg-icons";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
// functional card component to display single item
export default function BlogCard(props) {
var shortMonthName = new Intl.DateTimeFormat("en-US", {
month: "short",
@sabesansathananthan
sabesansathananthan / Contact.js
Last active September 16, 2020 20:48
Serverless Material UI Contact form render part
<form className="contact-form" onSubmit={(e) => this.formSubmit(e)}>
<TextField
id="standard-multiline-flexible"
label="Message"
placeholder="Enter Message"
variant="outlined"
multiline
rowsMax={4}
value={this.state.message}
onChange={(e) => this.setState({ message: e.target.value })}