add fetch inquiry

This commit is contained in:
Hope87 2021-06-28 17:57:28 +03:00
parent b0ca345dbb
commit 8e607ee21f
4 changed files with 84 additions and 53 deletions

View File

@ -4,6 +4,7 @@ import Description from '../Description/Description';
import front from '../../images/front_end.png'; import front from '../../images/front_end.png';
import back from '../../images/back_end.png'; import back from '../../images/back_end.png';
import design from '../../images/design.png'; import design from '../../images/design.png';
// import { fetchProfile } from '../../server/server';
export const candidatesList = [ export const candidatesList = [
{ {
@ -58,6 +59,15 @@ const Home = () => {
const [selectedTab, setSelectedTab] = useState(''); const [selectedTab, setSelectedTab] = useState('');
// useEffect(() => {
// setTabs(tabsList);
// setCandidates(candidatesList);
// fetchProfile('https://guild.craft-group.xyz/api/profile')
// .then((profileArr) => setProfiles(profileArr))
// .catch((e) => console.log(e));
// }, []);
useEffect(() => { useEffect(() => {
setTabs(tabsList); setTabs(tabsList);
setCandidates(candidatesList); setCandidates(candidatesList);
@ -65,7 +75,6 @@ const Home = () => {
fetch('https://guild.craft-group.xyz/api/skills/skills-on-main-page') fetch('https://guild.craft-group.xyz/api/skills/skills-on-main-page')
.then((response) => response.json()) .then((response) => response.json())
.then((res) => { .then((res) => {
console.log('RES', res);
const keys = Object.keys(res); const keys = Object.keys(res);
const values = Object.values(res); const values = Object.values(res);

View File

@ -38,6 +38,12 @@
padding-right: 20px; padding-right: 20px;
} }
@media (max-width: 575.98px) {
.input__text > input {
max-width: 460px;
}
}
.input__number > input { .input__number > input {
width: 141px; width: 141px;
height: 42px; height: 42px;
@ -50,6 +56,12 @@
text-align: center; text-align: center;
} }
@media (max-width: 575.98px) {
.input__number > input {
max-width: 141px;
}
}
.reportForm__form > img { .reportForm__form > img {
margin-top: 5px; margin-top: 5px;
width: 23px; width: 23px;

View File

@ -122,6 +122,10 @@
border-radius: 5px; border-radius: 5px;
border: 1px solid #c4c4c4; border: 1px solid #c4c4c4;
background-color: #ffffff; background-color: #ffffff;
font-size: 1.8em;
padding-left: 20px;
padding-right: 20px;
outline: none;
} }
.reportForm__footer { .reportForm__footer {

6
src/server/server.js Normal file
View File

@ -0,0 +1,6 @@
export const fetchProfile = async (link, index = '') => {
const response = await fetch(`${link}/${index}`);
let data = await response.json();
return data;
};