|
|
@ -42,12 +42,12 @@ function RandomImage(props) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className="random-image-container">
|
|
|
|
<div className="random-image-container">
|
|
|
|
<div className="controls">
|
|
|
|
<div className="controls">
|
|
|
|
<span role="button" tabIndex={0} disabled={loading} onClick={selectImage}>
|
|
|
|
<button disabled={loading} onClick={selectImage}>
|
|
|
|
Use Image
|
|
|
|
Use Image
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
<span role="button" tabIndex={0} disabled={loading} onClick={() => updateIndex(i => i + 1)}>
|
|
|
|
<button disabled={loading} onClick={() => updateIndex(i => i + 1)}>
|
|
|
|
Try Another
|
|
|
|
Try Another
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="image">{loading && <Spinner />}</div>
|
|
|
|
<div className="image">{loading && <Spinner />}</div>
|
|
|
|
{photographer && <PhotoCredit photographer={photographer} />}
|
|
|
|
{photographer && <PhotoCredit photographer={photographer} />}
|
|
|
@ -68,13 +68,19 @@ function RandomImage(props) {
|
|
|
|
margin-bottom: 4px;
|
|
|
|
margin-bottom: 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
span {
|
|
|
|
button {
|
|
|
|
opacity: ${loading ? 0.5 : 1};
|
|
|
|
opacity: ${loading ? 0.5 : 1};
|
|
|
|
cursor: ${loading ? 'not-allowed' : 'pointer'};
|
|
|
|
cursor: ${loading ? 'not-allowed' : 'pointer'};
|
|
|
|
user-select: none;
|
|
|
|
user-select: none;
|
|
|
|
|
|
|
|
appearance: none;
|
|
|
|
|
|
|
|
border: none;
|
|
|
|
|
|
|
|
background: none;
|
|
|
|
|
|
|
|
color: inherit;
|
|
|
|
|
|
|
|
font-size: inherit;
|
|
|
|
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[role='button']:focus {
|
|
|
|
button:focus {
|
|
|
|
outline: none;
|
|
|
|
outline: none;
|
|
|
|
text-decoration: underline;
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|