work and created develop branch

This commit is contained in:
2024-11-14 17:46:13 -05:00
parent 9cbf394b0c
commit cca47965a6
36 changed files with 2315 additions and 54 deletions

View File

@@ -0,0 +1,25 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types' //ES6
import styles from './styles.module.css'
export default class BasicClassComponent extends Component {
constructor(props){
super(props)
this.state = {
}
}
render(){
return (
<div >
<h1>Basic Component</h1>
</div>
)
}
}
BasicClassComponent.propTypes = {
};

View File

@@ -0,0 +1,23 @@
{
"name": "basicclasscomponent",
"version": "0.0.0",
"private": true,
"main": "./index",
"author": {
"name": "Don Strawsburg",
"email": "don@goforward.group",
"url": "https://goforward.group/"
},
"contributors": [
{
"name": "Don Strawsburg",
"email": "don@goforward.group",
"url": "https://goforward.group/"
},
{
"name": "Sean Strawsburg",
"email": "sean@goforward.group",
"url": "https://goforward.group/"
}
]
}

View File

@@ -0,0 +1,10 @@
import styles from './styles.module.css'
export const BasicFunctionComponent = () => {
return (
<div>
</div>
)
}
export default BasicFunctionComponent;

View File

@@ -0,0 +1,23 @@
{
"name": "basicfunctioncomponent",
"version": "0.0.0",
"private": true,
"main": "./index",
"author": {
"name": "Don Strawsburg",
"email": "don@goforward.group",
"url": "https://goforward.group/"
},
"contributors": [
{
"name": "Don Strawsburg",
"email": "don@goforward.group",
"url": "https://goforward.group/"
},
{
"name": "Sean Strawsburg",
"email": "sean@goforward.group",
"url": "https://goforward.group/"
}
]
}

View File

@@ -0,0 +1,14 @@
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 80%;
margin: auto;
text-align: center;
padding: 1em;
}
.close {
font-size: 1.5em;
float: right;
cursor: pointer;
}

View File

@@ -0,0 +1,23 @@
import React from "react";
import "./index.css";
class Card extends React.Component {
constructor( props ) {
super(props)
this.state = { show : true };
}
render() {
return (
<div className="card" >
<span
className="close" onClick={this.props.dataclick}
datatitle={this.props.title}>&times;</span>
<h3>{this.props.title}</h3>
<p>{this.props.content}</p>
</div>
);
}
}
export default Card;

View File

@@ -0,0 +1,3 @@
.cardList {
}

View File

@@ -0,0 +1,38 @@
import React from "react";
import ReactDOM from "react-dom";
import Card from "../Card/";
import data from "../../data.json";
class CardList extends React.Component {
constructor(props) {
super(props);
this.state = { cards: data.cards };
}
remove() {
}
render() {
return (
<div>
{
this.state.cards.map((card, index) => {
return <Card
key={index}
title={card.title}
content={card.content}
dataclick={this.remove}
/>
})
});
}
</div>
);
}
}
export default CardList;

View File

@@ -0,0 +1,38 @@
import React from "react";
import styles from "./styles.module.css";
class Weather extends React.Component {
constructor(props) {
super(props);
this.state = {
show: true,
};
this.props = {
name : '',
temperature : '',
temperatureUnit : '',
detailedForecast : '',
}
}
render() {
return (
<div className="card">
<span
className="close"
onClick={this.props.dataclick}
datatitle={this.props.title}
>&times;
</span>
<p>{this.props.name}</p>
<p>{this.props.temperature}</p>
<p>{this.props.temperatureUnit}</p>
<p>{this.props.detailedForecast}</p>
</div>
);
}
}
export default Weather;

View File

@@ -0,0 +1,14 @@
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 80%;
margin: auto;
text-align: center;
padding: 1em;
}
.close {
font-size: 1.5em;
float: right;
cursor: pointer;
}

View File

@@ -0,0 +1,3 @@
.cardList {
}

View File

@@ -0,0 +1,54 @@
import React from "react";
import ReactDOM from "react-dom";
import Weather from "../Weather";
class WeatherList extends React.Component {
constructor(props) {
super(props);
this.state = { periods: [] };
}
remove() {
}
render() {
return (
<div>
{
this.state.periods.map((period, index) => {
return <Weather
key={index}
name={period.name}
temperature={period.temperature}
temperatureUnit={period.temperatureUnit}
detailedForecast={period.detailedForecast}
dataclick={this.remove}
/>
})
});
}
</div>
);
}
getData() {
fetch("https://api.weather.gov/gridpoints/MLB/25,69/forecast")
.then(response => response.json())
.then(data => this.setState({ periods : data.properties.periods}))
.then(data => console.log(data));
this.setState({
detailedForcast : 'Test Detailed forcast',
name : 'Test data',
temperature : '90',
temperatureUnit : 'Celcius'});
}
componentDidMount() {
this.getData();
}
}
export default WeatherList;

View File

@@ -0,0 +1,11 @@
export default async function Page() {
let data = await fetch('https://api.vercel.app/blog')
let posts = await data.json()
return (
<ul>
{posts.map((post) => (
<li key={post.id}>{post.title}</li>
))}
</ul>
)
}