- Notifications
You must be signed in to change notification settings - Fork42
Icons, Fonts & Notifications#102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
2ab6c3a
dee6684
e3f7a84
27324bc
f7d82c8
feeaf97
8dc00aa
fc5d41c
f6b0bda
a85dd93
5a6120b
be1e1db
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
This file was deleted.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* css url font paths do not match up from the web-app as it is moved inside of build | ||
* in order to load fonts and icons, these paths must be reconciled. | ||
*/ | ||
constfs=require('fs')// eslint-disable-line | ||
// find the generated main css file | ||
constgetMainCSSFile=()=>{ | ||
constregex=/^main.[a-z0-9]+.chunk.css$/ | ||
constmainCss=fs.readdirSync('build/static/css').filter(filename=>filename.match(regex)) | ||
if(!mainCss.length){ | ||
thrownewError('No main.css file found in build/static/css') | ||
} | ||
returnmainCss[0] | ||
} | ||
// remap the font paths from the borken /fonts/ => ../../fonts/ | ||
constremapFontPaths=()=>{ | ||
constmainCSSFile=getMainCSSFile() | ||
constfile=fs.readFileSync(`build/static/css/${mainCSSFile}`,'utf8') | ||
constfontUrlRegex=/url\(\/fonts\//g | ||
constremappedFile=file.replace(fontUrlRegex,'url(../../fonts/') | ||
fs.writeFileSync(`build/static/css/${mainCSSFile}`,remappedFile) | ||
} | ||
remapFontPaths() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
importMessagefrom'../Message' | ||
import*asReactfrom'react' | ||
import*asTfrom'typings' | ||
import{css,jsx}from'@emotion/core' | ||
constdurations={ | ||
success:1000, | ||
warning:4500, | ||
error:4500, | ||
loading:300000, | ||
} | ||
constuseTimeout=({ duration, key}:{duration:number;key:string})=>{ | ||
const[timeoutClose,setTimeoutClose]=React.useState(false) | ||
React.useEffect(()=>{ | ||
setTimeoutClose(false) | ||
consttimeout=setTimeout(()=>{ | ||
setTimeoutClose(true) | ||
},duration) | ||
return()=>{ | ||
clearTimeout(timeout) | ||
} | ||
},[key]) | ||
returntimeoutClose | ||
} | ||
constTestMessage=(props:T.TestStatus)=>{ | ||
constduration=durations[props.type] | ||
consttimeoutClose=useTimeout({ duration,key:props.title}) | ||
return( | ||
<Message | ||
key={props.title} | ||
type={props.type} | ||
title={props.title} | ||
closed={timeoutClose} | ||
size="medium" | ||
closeable={props.type!=='loading'} | ||
content={props.content} | ||
/> | ||
) | ||
} | ||
exportdefaultTestMessage |
Uh oh!
There was an error while loading.Please reload this page.