added and styled weather-fetch and card component. also applied some styling to app.css

This commit is contained in:
Yusuf İpek
2021-01-21 16:03:50 +03:00
parent b0e5713b24
commit c1bc1b06cb
10 changed files with 908 additions and 53 deletions
+1 -1
View File
@@ -1 +1 @@
[{"/home/yusuf/Programming/React/homepage/src/index.js":"1","/home/yusuf/Programming/React/homepage/src/App.js":"2","/home/yusuf/Programming/React/homepage/src/reportWebVitals.js":"3","/home/yusuf/Programming/React/homepage/src/components/time/time-component.jsx":"4"},{"size":500,"mtime":1611166245620,"results":"5","hashOfConfig":"6"},{"size":488,"mtime":1611230568467,"results":"7","hashOfConfig":"6"},{"size":362,"mtime":1611166245620,"results":"8","hashOfConfig":"6"},{"size":0,"mtime":1611230222854,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},"p1t955",{"filePath":"13","messages":"14","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"19"},"/home/yusuf/Programming/React/homepage/src/index.js",[],["20","21"],"/home/yusuf/Programming/React/homepage/src/App.js",[],"/home/yusuf/Programming/React/homepage/src/reportWebVitals.js",[],"/home/yusuf/Programming/React/homepage/src/components/time/time-component.jsx",[],["22","23"],{"ruleId":"24","replacedBy":"25"},{"ruleId":"26","replacedBy":"27"},{"ruleId":"24","replacedBy":"28"},{"ruleId":"26","replacedBy":"29"},"no-native-reassign",["30"],"no-negated-in-lhs",["31"],["30"],["31"],"no-global-assign","no-unsafe-negation"] [{"/home/yusuf/Programming/React/homepage/src/index.js":"1","/home/yusuf/Programming/React/homepage/src/App.js":"2","/home/yusuf/Programming/React/homepage/src/reportWebVitals.js":"3","/home/yusuf/Programming/React/homepage/src/components/time/time-component.jsx":"4","/home/yusuf/Programming/React/homepage/src/components/fetch weather/weather-fetch.jsx":"5","/home/yusuf/Programming/React/homepage/src/components/card/card-component.jsx":"6"},{"size":500,"mtime":1611166245620,"results":"7","hashOfConfig":"8"},{"size":559,"mtime":1611234006423,"results":"9","hashOfConfig":"8"},{"size":362,"mtime":1611166245620,"results":"10","hashOfConfig":"8"},{"size":496,"mtime":1611233470447,"results":"11","hashOfConfig":"8"},{"size":993,"mtime":1611233413913,"results":"12","hashOfConfig":"8"},{"size":261,"mtime":1611234119493,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"16"},"p1t955",{"filePath":"17","messages":"18","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"19","messages":"20","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"16"},{"filePath":"21","messages":"22","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"23","messages":"24","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"25","messages":"26","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/yusuf/Programming/React/homepage/src/index.js",[],["27","28"],"/home/yusuf/Programming/React/homepage/src/App.js",[],"/home/yusuf/Programming/React/homepage/src/reportWebVitals.js",[],"/home/yusuf/Programming/React/homepage/src/components/time/time-component.jsx",[],"/home/yusuf/Programming/React/homepage/src/components/fetch weather/weather-fetch.jsx",[],"/home/yusuf/Programming/React/homepage/src/components/card/card-component.jsx",[],{"ruleId":"29","replacedBy":"30"},{"ruleId":"31","replacedBy":"32"},"no-native-reassign",["33"],"no-negated-in-lhs",["34"],"no-global-assign","no-unsafe-negation"]
+807 -2
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -7,10 +7,12 @@
"@testing-library/react": "^11.2.3", "@testing-library/react": "^11.2.3",
"@testing-library/user-event": "^12.6.0", "@testing-library/user-event": "^12.6.0",
"moment": "^2.29.1", "moment": "^2.29.1",
"node-sass": "^4.14.1",
"react": "^17.0.1", "react": "^17.0.1",
"react-dom": "^17.0.1", "react-dom": "^17.0.1",
"react-live-clock": "^5.0.13", "react-live-clock": "^5.0.13",
"react-scripts": "4.0.1", "react-scripts": "4.0.1",
"scss": "^0.2.4",
"web-vitals": "^0.2.4" "web-vitals": "^0.2.4"
}, },
"scripts": { "scripts": {
+2 -36
View File
@@ -1,38 +1,4 @@
.App { body {
text-align: center; background-color: #181a1b;
}
.App-logo {
height: 40vmin;
pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}
.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white; color: white;
} }
.App-link {
color: #61dafb;
}
@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
+10 -14
View File
@@ -1,27 +1,23 @@
import "./App.css"; import "./App.css";
import React, { Component } from "react"; import React, { Component } from "react";
import Time from "./components/time/time-component";
import Forecast from "./components/fetch weather/weather-fetch";
import Card from "./components/card/card-component";
class App extends Component { class App extends Component {
constructor() { constructor() {
super(); super();
this.state = { this.state = {};
time: new Date(),
};
} }
currentTime() {
this.setState({
time: new Date(),
});
}
componentDidMount() {
setInterval(() => this.currentTime(), 1000);
}
render() { render() {
const card1 = ["deneme", "deneme2"];
return ( return (
<div className="App"> <div className="App">
<h1>{this.state.time.toLocaleTimeString()}</h1> <h1>
<Time />
</h1>
<Forecast />
<Card list={card1} />
</div> </div>
); );
} }
+15
View File
@@ -0,0 +1,15 @@
import "./card-style.scss";
const Card = (props) => {
return (
<div className="card">
<ul className="list">
{props.list.map((li) => (
<li className="text">{li}</li>
))}
</ul>
</div>
);
};
export default Card;
+22
View File
@@ -0,0 +1,22 @@
.card {
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 250px;
.list {
margin-left: 40px;
width: 200px;
height: 230px;
background-color: #242f34;
border: 1px solid grey;
border-radius: 5px;
padding: 20px;
.text {
text-align: center;
list-style: none;
line-height: 30px;
}
}
}
@@ -0,0 +1,11 @@
.forecast {
display: flex;
justify-content: center;
align-items: center;
}
@media screen and (max-width: 700px) {
.forecast {
width: 60px;
}
}
+28
View File
@@ -0,0 +1,28 @@
import React, { Component } from "react";
import "./time-component.scss";
class Time extends Component {
constructor(props) {
super(props);
this.state = {
time: new Date(),
};
}
currentTime() {
this.setState({
time: new Date(),
});
}
componentDidMount() {
setInterval(() => this.currentTime(), 1000);
}
render() {
return (
<div className="clock">{this.state.time.toLocaleTimeString("en-GB")}</div>
);
}
}
export default Time;
+10
View File
@@ -0,0 +1,10 @@
.clock {
text-align: center;
font-size: 90px;
}
@media screen and (max-width: 700px) {
.clock {
font-size: 60px;
}
}