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

@ -1,57 +1,69 @@
.reportForm__form { .reportForm__form {
position: relative; position: relative;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-left: 14px; margin-left: 14px;
margin-bottom: 28px; margin-bottom: 28px;
} }
.reportForm__form > span { .reportForm__form > span {
font-family: 'GT Eesti Pro Display'; font-family: 'GT Eesti Pro Display';
font-size: 2em; font-size: 2em;
font-weight: 700; font-weight: 700;
font-style: normal; font-style: normal;
letter-spacing: normal; letter-spacing: normal;
text-align: left; text-align: left;
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 7px; bottom: 7px;
} }
.input__text, .input__text,
.input__number { .input__number {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-left: 20px; margin-left: 20px;
} }
.input__text > input {
width: 460px;
height: 42px;
box-shadow: 0 0 59px rgba(44, 44, 44, 0.05);
border-radius: 5px;
border: 1px solid #c4c4c4;
background-color: #ffffff;
outline: none;
font-size: 1.8em;
padding-left: 20px;
padding-right: 20px;
}
@media (max-width: 575.98px) {
.input__text > input { .input__text > input {
width: 460px; max-width: 460px;
height: 42px;
box-shadow: 0 0 59px rgba(44, 44, 44, 0.05);
border-radius: 5px;
border: 1px solid #c4c4c4;
background-color: #ffffff;
outline: none;
font-size: 1.8em;
padding-left: 20px;
padding-right: 20px;
} }
}
.input__number > input {
width: 141px;
height: 42px;
box-shadow: 0 0 59px rgba(44, 44, 44, 0.05);
border-radius: 5px;
border: 1px solid #c4c4c4;
background-color: #ffffff;
outline: none;
font-size: 1.8em;
text-align: center;
}
@media (max-width: 575.98px) {
.input__number > input { .input__number > input {
width: 141px; max-width: 141px;
height: 42px;
box-shadow: 0 0 59px rgba(44, 44, 44, 0.05);
border-radius: 5px;
border: 1px solid #c4c4c4;
background-color: #ffffff;
outline: none;
font-size: 1.8em;
text-align: center;
} }
}
.reportForm__form > img {
margin-top: 5px; .reportForm__form > img {
width: 23px; margin-top: 5px;
height: 23px; width: 23px;
} height: 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;
};