-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into fix/separate-client-server
# Conflicts: # client/src/core/client/admin/routes/Configure/sections/General/FlairBadgeImagePreview.css # client/src/core/client/admin/routes/Configure/sections/General/FlairBadgeImagePreview.tsx # client/src/core/client/stream/test/comments/components/CommentContainer.spec.tsx # client/src/core/client/ui/components/icons/ImageFileWarningIcon.tsx
- Loading branch information
Showing
9 changed files
with
163 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,6 @@ | |
margin-left: auto; | ||
} | ||
|
||
.imagePreview { | ||
max-height: 25px; | ||
} | ||
|
||
.addButton { | ||
height: 34px; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
client/src/core/client/admin/routes/Configure/sections/General/FlairBadgeImagePreview.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.imagePreview { | ||
max-height: 25px; | ||
min-height: 8px; | ||
min-width: 8px; | ||
} |
31 changes: 31 additions & 0 deletions
31
client/src/core/client/admin/routes/Configure/sections/General/FlairBadgeImagePreview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { FunctionComponent, useCallback, useState } from "react"; | ||
|
||
import { ImageFileWarningIcon, SvgIcon } from "coral-ui/components/icons"; | ||
|
||
import styles from "./FlairBadgeImagePreview.css"; | ||
|
||
interface Props { | ||
url: string; | ||
alt: string; | ||
} | ||
|
||
export const FlairBadgeImagePreview: FunctionComponent<Props> = ({ | ||
url, | ||
alt, | ||
}) => { | ||
const [error, setError] = useState<boolean>(false); | ||
const onError = useCallback(() => { | ||
setError(true); | ||
}, [setError]); | ||
|
||
return error ? ( | ||
<SvgIcon Icon={ImageFileWarningIcon} size="lg" /> | ||
) : ( | ||
<img | ||
className={styles.imagePreview} | ||
src={url} | ||
alt={alt} | ||
onError={onError} | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
client/src/core/client/ui/components/icons/ImageFileWarningIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import React, { FunctionComponent } from "react"; | ||
|
||
const ImageFileWarningIcon: FunctionComponent = () => { | ||
// https://www.streamlinehq.com/icons/streamline-regular/files-folders/image-files/image-file-warning | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
fill="none" | ||
viewBox="-0.75 -0.75 48 48" | ||
> | ||
<path | ||
stroke="currentColor" | ||
d="M33.421875 40.6875a0.7265625 0.7265625 0 0 1 0 -1.453125" | ||
></path> | ||
<path | ||
stroke="currentColor" | ||
d="M33.421875 40.6875a0.7265625 0.7265625 0 0 0 0 -1.453125" | ||
></path> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
d="M33.421875 34.875v-5.8125" | ||
></path> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
d="M44.6845625 40.071374999999996a3.4351874999999996 3.4351874999999996 0 0 1 -3.0748124999999997 4.9755h-16.37575a3.4390625 3.4390625 0 0 1 -3.0748124999999997 -4.9755l8.187875 -16.3738125a3.437125 3.437125 0 0 1 6.1496249999999995 0l8.187875 16.3738125Z" | ||
></path> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
d="M14.53125 39.234375H4.359375a2.90625 2.90625 0 0 1 -2.90625 -2.90625V4.359375a2.90625 2.90625 0 0 1 2.90625 -2.90625h20.593687499999998a2.90625 2.90625 0 0 1 2.05375 0.8505625l5.5645 5.5645a2.90625 2.90625 0 0 1 0.8505625 2.05375V15.984375" | ||
></path> | ||
<path | ||
stroke="currentColor" | ||
d="M10.171875 12.3515625a0.7265625 0.7265625 0 1 1 0 -1.453125" | ||
></path> | ||
<path | ||
stroke="currentColor" | ||
d="M10.171875 12.3515625a0.7265625 0.7265625 0 1 0 0 -1.453125" | ||
></path> | ||
<path | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
d="M24.9085 20.96375 21.796875 15.984375a1.4511875 1.4511875 0 0 0 -2.398625 -0.027125l-3.875 5.5218750000000005L13.13625 19.568749999999998a1.453125 1.453125 0 0 0 -2.1176874999999997 0.32743750000000005l-3.7529375000000003 7.71125h11.625" | ||
></path> | ||
</svg> | ||
); | ||
}; | ||
|
||
export default ImageFileWarningIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters