add api index page

This commit is contained in:
gerchek 2022-01-21 12:31:01 +05:00
parent fc62c98abb
commit 8c45b45e6a
32 changed files with 245 additions and 229 deletions

View File

@ -1,19 +1,19 @@
{
"files": {
"main.css": "/static/css/main.d5690b72.chunk.css",
"main.js": "/static/js/main.09dad639.chunk.js",
"main.js.map": "/static/js/main.09dad639.chunk.js.map",
"main.js": "/static/js/main.161d2a6e.chunk.js",
"main.js.map": "/static/js/main.161d2a6e.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.80c04ae7.js",
"runtime-main.js.map": "/static/js/runtime-main.80c04ae7.js.map",
"static/css/2.d555f809.chunk.css": "/static/css/2.d555f809.chunk.css",
"static/js/2.3f3ab58c.chunk.js": "/static/js/2.3f3ab58c.chunk.js",
"static/js/2.3f3ab58c.chunk.js.map": "/static/js/2.3f3ab58c.chunk.js.map",
"static/js/2.f408bb38.chunk.js": "/static/js/2.f408bb38.chunk.js",
"static/js/2.f408bb38.chunk.js.map": "/static/js/2.f408bb38.chunk.js.map",
"static/js/3.6828d12d.chunk.js": "/static/js/3.6828d12d.chunk.js",
"static/js/3.6828d12d.chunk.js.map": "/static/js/3.6828d12d.chunk.js.map",
"index.html": "/index.html",
"static/css/2.d555f809.chunk.css.map": "/static/css/2.d555f809.chunk.css.map",
"static/css/main.d5690b72.chunk.css.map": "/static/css/main.d5690b72.chunk.css.map",
"static/js/2.3f3ab58c.chunk.js.LICENSE.txt": "/static/js/2.3f3ab58c.chunk.js.LICENSE.txt",
"static/js/2.f408bb38.chunk.js.LICENSE.txt": "/static/js/2.f408bb38.chunk.js.LICENSE.txt",
"static/media/airport.9ca79b5c.jpg": "/static/media/airport.9ca79b5c.jpg",
"static/media/downArrow.0bea9b11.svg": "/static/media/downArrow.0bea9b11.svg",
"static/media/emblemLogo.80dd243c.svg": "/static/media/emblemLogo.80dd243c.svg",
@ -40,23 +40,14 @@
"static/media/serviceRequest_4.405c4f86.jpg": "/static/media/serviceRequest_4.405c4f86.jpg",
"static/media/app.scss": "/static/media/sliderPrev.ca001cbb.svg",
"static/media/structureImg.551590c2.jpg": "/static/media/structureImg.551590c2.jpg",
"static/media/tabImgSecond_1.03f01b5e.jpg": "/static/media/tabImgSecond_1.03f01b5e.jpg",
"static/media/tabImgSecond_2.33da6c85.jpg": "/static/media/tabImgSecond_2.33da6c85.jpg",
"static/media/tabImgSecond_3.0ad34a6a.jpg": "/static/media/tabImgSecond_3.0ad34a6a.jpg",
"static/media/tabImgSecond_4.81a74816.jpg": "/static/media/tabImgSecond_4.81a74816.jpg",
"static/media/tabImgSecond_5.849a0513.jpg": "/static/media/tabImgSecond_5.849a0513.jpg",
"static/media/tabImgSecond_6.43fca246.jpg": "/static/media/tabImgSecond_6.43fca246.jpg",
"static/media/tabImg_1.3a240e87.jpg": "/static/media/tabImg_1.3a240e87.jpg",
"static/media/tabImg_2.cef6ec44.jpg": "/static/media/tabImg_2.cef6ec44.jpg",
"static/media/tabImg_3.6d0523a2.jpg": "/static/media/tabImg_3.6d0523a2.jpg",
"static/media/tdh.25d64290.jpg": "/static/media/tdh.25d64290.jpg",
"static/media/turkmenTv.7810c539.jpg": "/static/media/turkmenTv.7810c539.jpg"
},
"entrypoints": [
"static/js/runtime-main.80c04ae7.js",
"static/css/2.d555f809.chunk.css",
"static/js/2.3f3ab58c.chunk.js",
"static/js/2.f408bb38.chunk.js",
"static/css/main.d5690b72.chunk.css",
"static/js/main.09dad639.chunk.js"
"static/js/main.161d2a6e.chunk.js"
]
}

View File

@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/><link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Etalon</title><link href="/static/css/2.d555f809.chunk.css" rel="stylesheet"><link href="/static/css/main.d5690b72.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,a,i=t[0],c=t[1],l=t[2],s=0,p=[];s<i.length;s++)a=i[s],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(t);p.length;)p.shift()();return u.push.apply(u,l||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,i=1;i<r.length;i++){var c=r[i];0!==o[c]&&(n=!1)}n&&(u.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={1:0},u=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+"static/js/"+({}[e]||e)+"."+{3:"6828d12d"}[e]+".chunk.js"}(e);var c=new Error;u=function(t){i.onerror=i.onload=null,clearTimeout(l);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,r[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/",a.oe=function(e){throw console.error(e),e};var i=this["webpackJsonpreact-etalon"]=this["webpackJsonpreact-etalon"]||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var f=c;r()}([])</script><script src="/static/js/2.3f3ab58c.chunk.js"></script><script src="/static/js/main.09dad639.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/><link href="https://fonts.googleapis.com/css2?family=Open+Sans&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>Etalon</title><link href="/static/css/2.d555f809.chunk.css" rel="stylesheet"><link href="/static/css/main.d5690b72.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function t(t){for(var n,a,i=t[0],c=t[1],l=t[2],s=0,p=[];s<i.length;s++)a=i[s],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&p.push(o[a][0]),o[a]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(t);p.length;)p.shift()();return u.push.apply(u,l||[]),r()}function r(){for(var e,t=0;t<u.length;t++){for(var r=u[t],n=!0,i=1;i<r.length;i++){var c=r[i];0!==o[c]&&(n=!1)}n&&(u.splice(t--,1),e=a(a.s=r[0]))}return e}var n={},o={1:0},u=[];function a(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,a),r.l=!0,r.exports}a.e=function(e){var t=[],r=o[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=o[e]=[t,n]}));t.push(r[2]=n);var u,i=document.createElement("script");i.charset="utf-8",i.timeout=120,a.nc&&i.setAttribute("nonce",a.nc),i.src=function(e){return a.p+"static/js/"+({}[e]||e)+"."+{3:"6828d12d"}[e]+".chunk.js"}(e);var c=new Error;u=function(t){i.onerror=i.onload=null,clearTimeout(l);var r=o[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),u=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+u+")",c.name="ChunkLoadError",c.type=n,c.request=u,r[1](c)}o[e]=void 0}};var l=setTimeout((function(){u({type:"timeout",target:i})}),12e4);i.onerror=i.onload=u,document.head.appendChild(i)}return Promise.all(t)},a.m=e,a.c=n,a.d=function(e,t,r){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/",a.oe=function(e){throw console.error(e),e};var i=this["webpackJsonpreact-etalon"]=this["webpackJsonpreact-etalon"]||[],c=i.push.bind(i);i.push=t,i=i.slice();for(var l=0;l<i.length;l++)t(i[l]);var f=c;r()}([])</script><script src="/static/js/2.f408bb38.chunk.js"></script><script src="/static/js/main.161d2a6e.chunk.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

View File

@ -1,11 +1,14 @@
// IMPORT MODULES
import React from "react";
import { Link } from "react-router-dom";
import i18n from '../../i18n';
import { withTranslation } from 'react-i18next';
// IMPORT IMAGES
import rightArrow from "../../svg/rightArrow.svg";
const Footer = () => {
const Footer = (props) => {
const {t} = props;
return (
<footer className="footer">
<div className="container">
@ -21,7 +24,7 @@ const Footer = () => {
<img src={rightArrow} alt="ARROW" />
</div>
<Link to="/etalons" className="footer-link-text">
Эталоны
{t('Эталоны')}
</Link>
</li>
<li>
@ -29,7 +32,7 @@ const Footer = () => {
<img src={rightArrow} alt="ARROW" />
</div>
<Link to="/news" className="footer-link-text">
Новости
{t('Новости')}
</Link>
</li>
</ul>
@ -44,7 +47,7 @@ const Footer = () => {
<img src={rightArrow} alt="ARROW" />
</div>
<Link to="/service" className="footer-link-text">
Информация
{t('Информация')}
</Link>
</li>
<li>
@ -52,7 +55,7 @@ const Footer = () => {
<img src={rightArrow} alt="ARROW" />
</div>
<Link to="/prices" className="footer-link-text">
Стоимость
{t('Стоимость')}
</Link>
</li>
</ul>
@ -67,7 +70,7 @@ const Footer = () => {
<img src={rightArrow} alt="ARROW" />
</div>
<Link to="/legislation" className="footer-link-text">
Законодательная база
{t('Законодательная база')}
</Link>
</li>
<li>
@ -78,7 +81,7 @@ const Footer = () => {
to="/measuring_register"
className="footer-link-text"
>
Государственный реестр средств измерений
{t('Государственный реестр средств измерений')}
</Link>
</li>
</ul>
@ -93,7 +96,7 @@ const Footer = () => {
</li>
<li>
<h6 className="footer-link-text">
E-mail: dem-turkm@online.tm
{t('E-mail: dem-turkm@online.tm')}
</h6>
</li>
</ul>
@ -105,12 +108,12 @@ const Footer = () => {
<ul className="footer-link-inner">
<li>
<h6 className="footer-link-text">
Туркменистан, г. Ашхабад
{t('Туркменистан, г. Ашхабад')}
</h6>
</li>
<li>
<h6 className="footer-link-text">
ул.1953, д.76 (Молодежная)
{t('ул.1953, д.76 (Молодежная)')}
</h6>
</li>
</ul>
@ -123,11 +126,11 @@ const Footer = () => {
href="https://turkmenstandartlary.gov.tm/"
className="footer-middle-link"
>
Главная государственная служба "Туркменстандартлары"
{t("Главная государственная служба 'Туркменстандартлары'")}
</a>
</div>
<div className="footer-bottom">
<h4>© 2019 Государственный эталонный центр</h4>
<h4>© 2019 {t('Государственный эталонный центр')}</h4>
</div>
</div>
</div>
@ -135,4 +138,5 @@ const Footer = () => {
);
};
export default Footer;
// export default Footer;
export default withTranslation()(Footer);

View File

@ -40,7 +40,7 @@ function Nav (props) {
<div className="nav-right">
<ul className="nav-link">
<li className="nav-link">
<Link to="/news">{t('Новости')}</Link>
<Link to="/news">{t('Новости-1')}</Link>
</li>
<li className="nav-link">
<Link to="/etalons">{t('Эталоны')}</Link>

View File

@ -1,107 +1,128 @@
// IMPORT MODULES
import React from "react";
import { Link } from "react-router-dom";
import i18n from '../../i18n';
import { withTranslation } from 'react-i18next';
// TAB_2
import RightArrow_2 from "../../svg/rightArrow_2.svg";
import SecondTabIMG_1 from "../../img/tabImgSecond_1.jpg";
import SecondTabIMG_2 from "../../img/tabImgSecond_2.jpg";
import SecondTabIMG_3 from "../../img/tabImgSecond_3.jpg";
import SecondTabIMG_4 from "../../img/tabImgSecond_4.jpg";
import SecondTabIMG_5 from "../../img/tabImgSecond_5.jpg";
import SecondTabIMG_6 from "../../img/tabImgSecond_6.jpg";
// import SecondTabIMG_1 from "../../img/tabImgSecond_1.jpg";
// import SecondTabIMG_2 from "../../img/tabImgSecond_2.jpg";
// import SecondTabIMG_3 from "../../img/tabImgSecond_3.jpg";
// import SecondTabIMG_4 from "../../img/tabImgSecond_4.jpg";
// import SecondTabIMG_5 from "../../img/tabImgSecond_5.jpg";
// import SecondTabIMG_6 from "../../img/tabImgSecond_6.jpg";
// const DepartmentsMain = () => {
class DepartmentsMain extends React.Component {
constructor(props) {
super(props);
this.state = {
items: [],
DataisLoaded: false,
error: null
};
}
componentDidMount() {
this._mounted = true
this.makeRemoteRequest();
}
componentWillUnmount() {
this._mounted = false
}
makeRemoteRequest = () => {
const url = `http://217.174.238.204:8888/api/v1/categories/3 + ?pgn=6`;
if (this._mounted) {
this.setState({ DataisLoaded: true });
}
setTimeout(() => {
fetch(url, {
method: 'GET',
})
.then(res => res.json())
.then(res => {
if (this._mounted) {
this.setState({
items: res.data[0].data,
error: res.message || null,
DataisLoaded: true,
})
console.log(res.data)
}
})
.catch(error => {
if (this._mounted) {
this.setState({ error, DataisLoaded: false});
}
});
}, 1500);
};
render() {
const { t } = this.props;
// const [pageIndex, setPageIndex] = useState(1);
var {DataisLoaded, items} = this.state;
if(!DataisLoaded){
return <div>Loading ....</div>
}else{
const DepartmentsMain = () => {
return (
<div className="depts-tab">
<div className="tab-header">
<h4 className="tab-header-text" id="tab-header-text">
Отделы
{t('Отделы')}
</h4>
<div className="tab-header-line"></div>
</div>
<div className="depts-wrapper">
<Link to="/department_geometric" className="dept">
{items.map(item=>(
<Link to={`/prices/meteorology/${item.slug}`} className="dept" key={item.id}>
<div className="dept-top">
<div className="dept-absolute">
<img src={RightArrow_2} alt="ARROW" />
</div>
<div className="dept-img">
<img src={SecondTabIMG_1} alt="MEASUREMENT" />
<img src={ item['featured_images'][0]['path'] } alt="MEASUREMENT" />
</div>
</div>
<div className="dept-bottom">
<h4>Отдел измерений геометрических и механических величин</h4>
</div>
</Link>
<Link to="/department_heat" className="dept">
<div className="dept-top">
<div className="dept-absolute">
<img src={RightArrow_2} alt="ARROW" />
</div>
<div className="dept-img">
<img src={SecondTabIMG_2} alt="MEASUREMENT" />
</div>
</div>
<div className="dept-bottom">
<h4>Отдел измерения теплотехнических величин</h4>
</div>
</Link>
<Link to="/department_volume" className="dept">
<div className="dept-top">
<div className="dept-absolute">
<img src={RightArrow_2} alt="ARROW" />
</div>
<div className="dept-img">
<img src={SecondTabIMG_3} alt="MEASUREMENT" />
</div>
</div>
<div className="dept-bottom">
<h4>Отдел по измерению объема и расхода веществ</h4>
</div>
</Link>
<Link to="/department_physics" className="dept">
<div className="dept-top">
<div className="dept-absolute">
<img src={RightArrow_2} alt="ARROW" />
</div>
<div className="dept-img">
<img src={SecondTabIMG_4} alt="MEASUREMENT" />
</div>
</div>
<div className="dept-bottom">
<h4>Отдел физико-химических и оптических измерений </h4>
</div>
</Link>
<Link to="/department_electricity" className="dept">
<div className="dept-top">
<div className="dept-absolute">
<img src={RightArrow_2} alt="ARROW" />
</div>
<div className="dept-img">
<img src={SecondTabIMG_5} alt="MEASUREMENT" />
</div>
</div>
<div className="dept-bottom">
<h4>Отдел электрических и радиоэлектронных измерений </h4>
</div>
</Link>
<Link to="department_maintenance" className="dept">
<div className="dept-top">
<div className="dept-absolute">
<img src={RightArrow_2} alt="ARROW" />
</div>
<div className="dept-img">
<img src={SecondTabIMG_6} alt="MEASUREMENT" />
</div>
</div>
<div className="dept-bottom">
<h4>Отдел технического обслуживания средств измерения</h4>
<h4>
{ i18n.language === 'en' &&
JSON.parse(item['translations'][0]['attribute_data']).title
}
{ i18n.language === 'ru' &&
item.title
}
{ i18n.language === 'tm' &&
JSON.parse(item['translations'][1]['attribute_data']).title
}
</h4>
</div>
</Link>
))}
</div>
</div>
);
}
}
};
export default DepartmentsMain;
// export default DepartmentsMain;
export default withTranslation()(DepartmentsMain);

View File

@ -6,9 +6,9 @@ import { withTranslation } from 'react-i18next';
// TAB_1
import RightArrowBlue from "../../svg/rightArrowBlue.svg";
import TabIMG1 from "../../img/tabImg_1.jpg";
import TabIMG2 from "../../img/tabImg_2.jpg";
import TabIMG3 from "../../img/tabImg_3.jpg";
// import TabIMG1 from "../../img/tabImg_1.jpg";
// import TabIMG2 from "../../img/tabImg_2.jpg";
// import TabIMG3 from "../../img/tabImg_3.jpg";
// const NewsMain = () => {
class NewsMain extends React.Component {
@ -36,7 +36,7 @@ import TabIMG3 from "../../img/tabImg_3.jpg";
makeRemoteRequest = () => {
const url = `http://217.174.238.204:8888/api/v1/categories/2`
const url = `http://217.174.238.204:8888/api/v1/categories/2 + ?pgn=3`;
if (this._mounted) {
this.setState({ DataisLoaded: true });
@ -52,7 +52,7 @@ import TabIMG3 from "../../img/tabImg_3.jpg";
.then(res => {
if (this._mounted) {
this.setState({
items: res.data[0]['posts'],
items: res.data[0].data,
error: res.message || null,
DataisLoaded: true,
})
@ -70,6 +70,8 @@ import TabIMG3 from "../../img/tabImg_3.jpg";
render() {
const { t } = this.props;
// const [pageIndex, setPageIndex] = useState(1);
var {DataisLoaded, items} = this.state;
@ -82,12 +84,12 @@ import TabIMG3 from "../../img/tabImg_3.jpg";
<div className="news-tab">
<div className="tab-header">
<h4 className="tab-header-text" id="tab-header-text">
Новости
{t('Новости')}
</h4>
<div className="tab-header-line"></div>
<div className="tab-header-link">
<Link to="/news">
<span>Все новости</span>
<span>{t('Все новости')}</span>
<div>
<img src={RightArrowBlue} alt="RIGHTARROW" />
</div>
@ -95,72 +97,43 @@ import TabIMG3 from "../../img/tabImg_3.jpg";
</div>
</div>
<div className="tab-wrapper">
<div className="tab">
{items.map(item=>(
<div className="tab" key={item.id}>
<div className="tab-top">
<div>
<img src={TabIMG1} alt="Turkmen carpets" />
<img src={ item['featured_images'][0]['path'] } alt="Turkmen carpets" />
</div>
</div>
<div className="tab-bottom">
<span className="tab-date">30.05.2021</span>
<h2 className="tab-name">
Состоялись мероприятия, приуроченные к Празднику туркменского
ковра
{ i18n.language === 'en' &&
JSON.parse(item['translations'][0]['attribute_data']).title
}
{ i18n.language === 'ru' &&
item.title
}
{ i18n.language === 'tm' &&
JSON.parse(item['translations'][1]['attribute_data']).title
}
</h2>
<div className="tab-header-link tab-link">
<Link to="/news/novelty">
<span>Подробнее</span>
<div>
<img src={RightArrowBlue} alt="RIGHTARROW" />
</div>
</Link>
</div>
</div>
</div>
<div className="tab">
<div className="tab-top">
<div>
<img src={TabIMG2} alt="Turkmen students" />
</div>
</div>
<div className="tab-bottom">
<span className="tab-date">25.05.2021</span>
<h2 className="tab-name">
Состоялись мероприятия, приуроченные к Празднику туркменского
ковра
</h2>
<div className="tab-header-link tab-link">
<Link to="/news/novelty">
<span>Подробнее</span>
<div>
<img src={RightArrowBlue} alt="RIGHTARROW" />
</div>
</Link>
</div>
</div>
</div>
<div className="tab">
<div className="tab-top">
<div>
<img src={TabIMG3} alt="Turkmen mothers" />
</div>
</div>
<div className="tab-bottom">
<span className="tab-date">25.05.2021</span>
<h2 className="tab-name">
Родителям первых детей, рождённых в день юбилея Ашхабада, вручены
подарки...
</h2>
<div className="tab-header-link tab-link">
<Link to="/news/novelty">
<span>Подробнее</span>
<Link to={`/news/${item.slug}`}>
<span>{t('Подробнее')}</span>
<div>
<img src={RightArrowBlue} alt="RIGHTARROW" />
</div>
</Link>
</div>
</div>
</div>
))}
</div>
</div>
);

View File

@ -1,5 +1,6 @@
// IMPORT MODULES
import React from "react";
import { withTranslation } from 'react-i18next';
// TAB_3
import RightArrow_2 from "../../svg/rightArrow_2.svg";
@ -8,12 +9,13 @@ import TdhIMG from "../../img/tdh.jpg";
import TurkmenTvIMG from "../../img/turkmenTv.jpg";
import AirportIMG from "../../img/airport.jpg";
const Sites = () => {
const Sites = (props) => {
const {t} = props;
return (
<div className="depts-tab">
<div className="tab-header sites-header">
<h4 className="tab-header-text" id="tab-header-text">
Полезные сайты
{t('Полезные сайты')}
</h4>
<div className="tab-header-line"></div>
</div>
@ -75,4 +77,5 @@ const Sites = () => {
);
};
export default Sites;
// export default Sites;
export default withTranslation()(Sites);

View File

@ -1,6 +1,6 @@
{
"test":"test_en",
"Новости":"All news",
"Новости-1":"All news",
"Эталоны":"Etalons",
"Услуги":"Services",
"Нормативная база":"Normative Base",
@ -12,6 +12,18 @@
"Реестр нормативной документации":"Register of normative documentation",
"О центре":"About Center",
"История центра":"History of Center",
"Структура центра":"Structure of Center"
"Структура центра":"Structure of Center",
"Объявления":"Announcement",
"Государственный эталонный центр":"State Etalon Center",
"Новости":"Latest News",
"Все новости":"All news",
"Подробнее":"Read more",
"Отделы":"Measurment Departments",
"Полезные сайты":"Recommended websites",
"Информация":"List",
"Туркменистан, г. Ашхабад":"Ashgabat, Turkmenistan",
"ул.1953, д.76 (Молодежная)":"76, 1953 str. (Molodezhy)",
"Главная государственная служба 'Туркменстандартлары'":"«Türkmenstandartlary» Main State Service"
}

View File

@ -1,6 +1,6 @@
{
"test":"test_ru",
"Новости":"Новости",
"Новости-1":"Новости",
"Эталоны":"Эталоны",
"Услуги":"Услуги",
"Нормативная база":"Нормативная база",
@ -12,5 +12,17 @@
"Реестр нормативной документации":"Реестр нормативной документации",
"О центре":"О центре",
"История центра":"История центра",
"Структура центра":"Структура центра"
"Структура центра":"Структура центра",
"Объявления":"Объявления",
"Государственный эталонный центр":"Государственный эталонный центр",
"Новости":"Новости",
"Все новости":"Все новости",
"Подробнее":"Подробнее",
"Отделы":"Отделы",
"Полезные сайты":"Полезные сайты",
"Информация":"Информация",
"Туркменистан, г. Ашхабад":"Ashgabat, Turkmenistan",
"ул.1953, д.76 (Молодежная)":"ул.1953, д.76 (Молодежная),",
"Главная государственная служба 'Туркменстандартлары'":"Главная государственная служба 'Туркменстандартлары'"
}

View File

@ -37,7 +37,7 @@ class CalibrateInstruments extends React.Component {
makeRemoteRequest = () => {
const url = `http://217.174.238.204:8888/api/v1/categories/8`
const url = `http://217.174.238.204:8888/api/v1/categories/8 + ?pgn=50`;
if (this._mounted) {
this.setState({ DataisLoaded: true });
@ -53,7 +53,7 @@ class CalibrateInstruments extends React.Component {
.then(res => {
if (this._mounted) {
this.setState({
items: res.data[0]['posts'],
items: res.data[0].data,
error: res.message || null,
DataisLoaded: true,
})

View File

@ -56,7 +56,7 @@ class Etalons extends React.Component {
makeRemoteRequest = () => {
const url = `http://217.174.238.204:8888/api/v1/categories/5`+'?pgn=50';
const url = `http://217.174.238.204:8888/api/v1/categories/5 + ?pgn=50`;
if (this._mounted) {
this.setState({ DataisLoaded: true });

View File

@ -36,7 +36,7 @@ class Legislation extends React.Component {
makeRemoteRequest = () => {
const url = `http://217.174.238.204:8888/api/v1/categories/6`
const url = `http://217.174.238.204:8888/api/v1/categories/6 + ?pgn=50`;
if (this._mounted) {
this.setState({ DataisLoaded: true });
@ -52,12 +52,12 @@ class Legislation extends React.Component {
.then(res => {
if (this._mounted) {
this.setState({
items: res.data[0]['posts'],
items: res.data[0].data,
error: res.message || null,
DataisLoaded: true,
})
// console.log(res.data)
console.log(res.data[0]['posts'][0]['translations'][1]['attribute_data'])
// console.log(res.data[0]['posts'][0]['translations'][1]['attribute_data'])
}
})

View File

@ -120,7 +120,7 @@ class Main extends React.Component {
<div className="second-slider">
<div className="tab-header">
<h4 className="tab-header-text" id="tab-header-text">
Объявления
{t('Объявления')}
{/* {t('test')} */}
</h4>
<div className="tab-header-line"></div>
@ -137,19 +137,19 @@ class Main extends React.Component {
loop={true}
>
<SwiperSlide className="swipe-slide">
<h2>Государственный эталонный центр</h2>
<h2>{t('Государственный эталонный центр')}</h2>
<div className="slider-img">
<img src={SliderIMG_2} alt="ETALON" />
</div>
</SwiperSlide>
<SwiperSlide className="swipe-slide">
<h2>Государственный эталонный центр</h2>
<h2>{t('Государственный эталонный центр')}</h2>
<div className="slider-img">
<img src={SliderIMG_2} alt="ETALON" />
</div>
</SwiperSlide>
<SwiperSlide className="swipe-slide">
<h2>Государственный эталонный центр</h2>
<h2>{t('Государственный эталонный центр')}</h2>
<div className="slider-img">
<img src={SliderIMG_2} alt="ETALON" />
</div>

View File

@ -36,7 +36,7 @@ class Meteorology extends React.Component {
makeRemoteRequest = () => {
const url = `http://217.174.238.204:8888/api/v1/categories/7`
const url = `http://217.174.238.204:8888/api/v1/categories/7 + ?pgn=50`;
if (this._mounted) {
this.setState({ DataisLoaded: true });
@ -52,7 +52,7 @@ class Meteorology extends React.Component {
.then(res => {
if (this._mounted) {
this.setState({
items: res.data[0]['posts'],
items: res.data[0].data,
error: res.message || null,
DataisLoaded: true,
})

View File

@ -45,7 +45,7 @@ class News extends React.Component {
makeRemoteRequest = () => {
const url = `http://217.174.238.204:8888/api/v1/categories/2`+'?pgn=9';
const url = `http://217.174.238.204:8888/api/v1/categories/2 + ?pgn=9`;
if (this._mounted) {
this.setState({ DataisLoaded: true });

View File

@ -139,10 +139,10 @@ class Post extends React.Component {
<div className="calibrate-thermo-inner" key={item[0]['id']}>
<div className="tab-header">
<h4 className="tab-header-text" id="tab-header-text">
{/* <h4 className="tab-header-text" id="tab-header-text">
Тарифы
</h4>
<div className="tab-header-line"></div>
<div className="tab-header-line"></div> */}
</div>
<div className="calibrate-thermo-content">
<div className="novelty-head">