Skip to content

Commit

Permalink
clean - optimize pages
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefomar724 committed Jun 27, 2022
1 parent 4499e9a commit 8db8730
Show file tree
Hide file tree
Showing 147 changed files with 550 additions and 85,148 deletions.
Binary file removed assets/about-us.jpg
Binary file not shown.
Binary file removed assets/advertise-with-us.jpg
Binary file not shown.
Binary file removed assets/getApi.jpg
Binary file not shown.
Binary file removed assets/privacy-policy.jpg
Binary file not shown.
Binary file removed assets/social-icons/facebook.png
Binary file not shown.
Binary file removed assets/social-icons/instagram.png
Binary file not shown.
Binary file removed assets/social-icons/messenger.png
Binary file not shown.
Binary file removed assets/social-icons/telegram.png
Binary file not shown.
Binary file removed assets/social-icons/twitter.png
Binary file not shown.
Binary file removed assets/social-icons/whatsapp.png
Binary file not shown.
Binary file removed assets/system-update.png
Binary file not shown.
Binary file removed assets/user-agreement.jpg
Binary file not shown.
44 changes: 16 additions & 28 deletions components/Header.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import ListItem from './ListItem'
import ListItem2 from './ListItem2'
import { RiArrowUpSLine, RiArrowDownSLine } from 'react-icons/ri'
import sysUpdate from '../assets/system-update.png'
import logo from './logo.svg'
import Paragraph from './Paragraph'
import HeaderRefreshIcon from './HeaderRefreshIcon'
import { Dropdown, Button } from 'react-bootstrap'
import { useEffect, useState } from 'react'
import Link from 'next/link'
import ListItemSocial from './ListItemSocial'
import googleApp from './footer/google-play-badge.png'
import AppleApp from './footer/apple-store-badge.png'
import { useTranslation } from 'react-i18next'

const lngs = {
Expand Down Expand Up @@ -114,7 +110,7 @@ const Header = () => {
<div className='container d-flex header'>
<div className='logo mr-auto'>
<a href='index.html'>
<img src={logo} alt='Syria Exchange' className='img' />
<img src='/logo.svg' alt='Syria Exchange' className='img' />
</a>
<div className='mt-2'>
<Paragraph pText='سوريا للصرافة' />
Expand All @@ -141,22 +137,10 @@ const Header = () => {
</Dropdown.Toggle>
<Dropdown.Menu>
{curr1.map((item, index) => (
<Link
href={`/international-coin/${index}`}
// state: {
// item: curr1[index],
// arName:
// curr1[index][0] == iter_curr_array[index][1]
// ? i18n.dir() === "ltr"
// ? iter_curr_array[index][2]
// : iter_curr_array[index][3]
// : "",
// },
key={index}
>
<Link href={`/international-coin/${index}`} key={index}>
<Dropdown.Item href='/' className={`${textAlign}`}>
<img
src={require(`./currIcons/${curr1[index][0]}.png`)}
src={`/currIcons/${curr1[index][0]}.png`}
className={`p-l-05 headerCurrIcon ${textAlign}`}
/>
<span>
Expand All @@ -180,10 +164,16 @@ const Header = () => {
</Dropdown.Toggle>
<Dropdown.Menu>
<Dropdown.Item href='https://play.google.com/store/apps/details?id=com.currencyapplication.currencyapplication&hl=ar&gl=US'>
<img src={googleApp} className='headerAppIcon' />
<img
src='/google-play-badge.png'
className='headerAppIcon'
/>
</Dropdown.Item>
<Dropdown.Item href='https://play.google.com/store/apps/details?id=com.currencyapplication.currencyapplication&hl=ar&gl=US'>
<img src={AppleApp} className='headerAppIcon' />
<img
src='/apple-store-badge.png'
className='headerAppIcon'
/>
</Dropdown.Item>
</Dropdown.Menu>
</Dropdown>
Expand All @@ -194,7 +184,7 @@ const Header = () => {
<ListItemSocial
icon={
<img
src={require('../assets/social-icons/messenger.png')}
src='/social-icons/messenger.png'
style={{ width: '50%' }}
/>
}
Expand All @@ -205,7 +195,7 @@ const Header = () => {
<ListItemSocial
icon={
<img
src={require('../assets/social-icons/telegram.png')}
src='/social-icons/telegram.png'
style={{ width: '50%' }}
/>
}
Expand All @@ -216,7 +206,7 @@ const Header = () => {
<ListItemSocial
icon={
<img
src={require('../assets/social-icons/facebook.png')}
src='/social-icons/facebook.png'
style={{ width: '50%' }}
/>
}
Expand All @@ -227,7 +217,7 @@ const Header = () => {
<ListItemSocial
icon={
<img
src={require('../assets/social-icons/instagram.png')}
src='/social-icons/instagram.png'
style={{ width: '50%' }}
/>
}
Expand All @@ -247,8 +237,6 @@ const Header = () => {
{lngs[lng].nativeName}
</button>
))}
{/* <ListItem anchotText="EN" liClass="liLanguage" />
<ListItem anchotText="AR" liClass="liLanguage liLanguage-active" /> */}
</ul>
</nav>
</div>
Expand All @@ -259,7 +247,7 @@ const Header = () => {
<Button className='btn-refresh' onClick={refreshPage}>
<HeaderRefreshIcon
anchotText={t('description.headerReload')}
icon={<img src={sysUpdate} className='refresh' />}
icon={<img src='/system-update.png' className='refresh' />}
iconStatus={true}
/>
</Button>
Expand Down
120 changes: 29 additions & 91 deletions components/Header111.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import ListItem2 from './ListItem2'
import { RiArrowUpSLine, RiArrowDownSLine } from 'react-icons/ri'
/* import sysUpdate from "../assets/system-update.png"; */
/* import Paragraph from "./Paragraph"; */
/* import HeaderRefreshIcon from "./HeaderRefreshIcon"; */
import { Dropdown, Button } from 'react-bootstrap'
import { Dropdown } from 'react-bootstrap'
import { useEffect, useState } from 'react'
import Link from 'next/link'
import ListItemSocial from './ListItemSocial'
import { useTranslation } from 'react-i18next'
import { Navbar, Nav, NavDropdown } from 'react-bootstrap'
import { Navbar, Nav } from 'react-bootstrap'
import { useRouter } from 'next/router'
import Skeleton from 'react-loading-skeleton'

Expand Down Expand Up @@ -86,13 +83,6 @@ const Header = () => {
getCityCoins()
}, [i18n])

// if (interCoins === undefined) {
// return null;
// }
// if (cityCoins === undefined) {
// return null;
// }

const city_curr = cityCoins?.city_coins?.map((item) => {
for (let [key, value] of Object.entries(item)) {
return [key, value]
Expand All @@ -106,11 +96,10 @@ const Header = () => {
}
return curr1
})
/* const refreshPage = (e) => {
window.router.reload(false);
}; */

let textAlign = i18n.dir() === 'ltr' ? 'text-left' : ''
let textAlignName = i18n.dir() === 'ltr' ? 'headerCurrName ' : ''

return (
<header id='header'>
<div className='container d-flex header'>
Expand All @@ -134,7 +123,6 @@ const Header = () => {
{t('description.headerHome')}
</a>
</Link>
{/* <ListItem anchotText={t("description.headerHome")} link="/" /> */}
<Link href='/syrian-pound'>
<a
onClick={() => setShowNav(false)}
Expand All @@ -147,14 +135,6 @@ const Header = () => {
{t('description.headerSYP')}
</a>
</Link>
{/* <ListItem
anchotText={t("description.headerSYP")}
link="/syrian-bound"
/> */}
{/* <ListItem
anchotText={t("description.headerGold")}
link="/gold"
/> */}
<Link href='/gold'>
<a
onClick={() => setShowNav(false)}
Expand All @@ -165,10 +145,6 @@ const Header = () => {
{t('description.headerGold')}
</a>
</Link>
{/* <ListItem
anchotText={t("description.headerTRY")}
link="/turkish-pound"
/> */}
<Link href='/turkish-pound'>
<a
className={
Expand All @@ -181,13 +157,7 @@ const Header = () => {
{t('description.headerTRY')}
</a>
</Link>
<li
/* className={
i18n.dir() === "ltr"
? "paddingLeftNews"
: " paddingRightNews"
} */
>
<li>
<Dropdown className='coins-dropdown'>
<Dropdown.Toggle
id='dropdown-basic'
Expand All @@ -203,54 +173,41 @@ const Header = () => {
<p>loading...</p>
) : (
curr1.map((item, index) => (
// <
// to={`/international-coin/${curr1[index][0]}`}
// to={{
// pathname: `/international-coin/${index}`,
// state: {
// item: curr1[index],
// arName:
// curr1[index][0] === iter_curr_array[index][1]
// ? i18n.dir() === "ltr"
// ? iter_curr_array[index][2]
// : iter_curr_array[index][3]
// : "",
// lastUpdated: interCoins?.last_update
// },
// }}
// onClick={() => setShowNav(false)}
// key={index}
// >
<Dropdown.Item
onClick={() => setShowNav(false)}
key={index}
to={`/international-coin/${curr1[index][0]}`}
className={`${textAlign}`}
href={`/international-coin/${curr1[index][0]}`}
as={Link}
className={`${textAlign}`}
>
<img
src={`/currIcons/${curr1[index][0]}.png`}
className={`p-l-05 headerCurrIcon ${textAlign}`}
alt={curr1[index][0]}
/>
<span className={textAlignName}>
{curr1[index][0] === iter_curr_array[index][1]
? i18n.dir() === 'ltr'
? iter_curr_array[index][2]
: iter_curr_array[index][3]
: ''}
</span>
<a
style={{
color: 'black',
display: 'flex',
alignItems: 'center',
marginBottom: '.4rem',
fontSize: '.8rem',
}}
>
<img
src={`/currIcons/${curr1[index][0]}.png`}
className={`p-l-05 headerCurrIcon ${textAlign}`}
alt={curr1[index][0]}
/>
<span className={textAlignName}>
{curr1[index][0] === iter_curr_array[index][1]
? i18n.dir() === 'ltr'
? iter_curr_array[index][2]
: iter_curr_array[index][3]
: ''}
</span>
</a>
</Dropdown.Item>
// </>
))
)}
</Dropdown.Menu>
</Dropdown>
</li>
{/* <ListItem
anchotText={t("description.headerNews")}
link="/news"
/> */}
<Link href='/news'>
<a
onClick={() => setShowNav(false)}
Expand Down Expand Up @@ -291,7 +248,6 @@ const Header = () => {
icon={
<img
src='/social-icons/messenger.png'
// style={{ width: "24px" }}
alt='messenger.png'
/>
}
Expand All @@ -303,7 +259,6 @@ const Header = () => {
icon={
<img
src='/social-icons/telegram.png'
// style={{ width: "24px" }}
alt='telegram.png'
/>
}
Expand All @@ -315,7 +270,6 @@ const Header = () => {
icon={
<img
src='/social-icons/facebook.png'
// style={{ width: "24px" }}
alt='facebook.png'
/>
}
Expand All @@ -327,7 +281,6 @@ const Header = () => {
icon={
<img
src='/social-icons/instagram.png'
// style={{ width: "24px" }}
alt='instagram.png'
/>
}
Expand Down Expand Up @@ -374,21 +327,6 @@ const Header = () => {
{city_curr ? (
<nav className='nav-menu2 '>
<ul className='justify-content-center'>
{/* <Button
className={
i18n.dir() === "ltr"
? " refreshPaddingEN btn-refresh"
: " refreshPaddingAR btn-refresh"
}
onClick={refreshPage}
>
<HeaderRefreshIcon
anchotText={t("description.headerReload")}
icon={<img src={sysUpdate} alt="sysUpdateIcon" />}
iconStatus={true}
liClass="refresh"
/>
</Button> */}
{city_curr[0][1].slice(0, 7).map((item) => (
<ListItem2
Lihover={
Expand Down
14 changes: 7 additions & 7 deletions components/HeaderRefreshIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const RefreshIcon = ({ anchotText, icon, iconStatus, liClass }) => {
<span>{iconStatus && icon}</span>
<span /* className={liClass} */>{anchotText}</span>
</li>
);
};
)
}
RefreshIcon.defaultProps = {
anchotText: "",
style: "",
liClass: "",
};
export default RefreshIcon;
anchotText: '',
style: '',
liClass: '',
}
export default RefreshIcon
Loading

1 comment on commit 8db8730

@vercel
Copy link

@vercel vercel bot commented on 8db8730 Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.