Skip to content
This repository has been archived by the owner on Mar 26, 2023. It is now read-only.

Commit

Permalink
Header GIF Logo, Sonunda Versiyon Kontrolü?
Browse files Browse the repository at this point in the history
  • Loading branch information
ayberktandogan committed Feb 19, 2020
1 parent 5b0f86e commit a3fca5c
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
7 changes: 4 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
REACT_APP_SITENAME=""
REACT_APP_SITEURL=""
REACT_APP_DEV_API_URL=""
REACT_APP_SITENAME=
REACT_APP_SITEURL=
REACT_APP_DEV_API_URL=
REACT_APP_HEADER_LOGO_TYPE=
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ npm-debug.log*
debug.log*
yarn-debug.log*
yarn-error.log*

src/static/fullLogo.gif
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "forfansubsadmin",
"version": "0.1.0",
"version": "2.2.4",
"private": true,
"homepage": "/admin",
"dependencies": {
Expand Down
9 changes: 7 additions & 2 deletions src/components/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
administrativePage,
logsPage
} from '../../config/front-routes'
import { fullLogo } from '../../config/theme/images'
import { fullLogo, fullLogoGif } from '../../config/theme/images'

const useStyles = makeStyles(theme => ({
root: {
Expand Down Expand Up @@ -230,7 +230,12 @@ export default function MiniDrawer() {
<MenuIcon />
</IconButton>
<Link to={indexPage} className={classes.logoContainer}>
<img className={classes.logo} src={fullLogo} alt="Site Logo" />
{
process.env.REACT_APP_HEADER_LOGO_TYPE === "gif" && fullLogoGif !== null ?
<img title="Site logo" loading="lazy" className={classes.logo} src={fullLogoGif} alt="Site Logo" />
:
<img title="Site logo" loading="lazy" className={classes.logo} src={fullLogo} alt="Site Logo" />
}
</Link>
<div style={{ padding: "12px", display: "flex", alignItems: "center" }}>
{userInfo.success ?
Expand Down
10 changes: 9 additions & 1 deletion src/config/theme/images.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import logo from '../../static/logo.png'
import fullLogo from '../../static/fullLogo.png'

export { logo, fullLogo }
var fullLogoGif = null
// GIF logosunun dosyalarını dene. Varsa içeri al, birisi yoksa hata ver ve header'da statik logoyu göster. (/components/header/header.js)
try {
fullLogoGif = require('../../static/fullLogo.gif');
} catch (err) {
console.warn('GIF logo bulunamadı.')
}

export { logo, fullLogo, fullLogoGif }

0 comments on commit a3fca5c

Please sign in to comment.