"full" images for two speakers

This commit is contained in:
Brandon Thomas committed 2020-07-04 04:59:13 -04:00
1 parent 1082049c8c
commit dbe0922aa1
5 files changed
+45 -2

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 KiB

+21
View File
@@ -199,6 +199,11 @@ form {
}
.speaker_info_component {
.full_image {
img {
max-width: 800px;
}
}
.speaker_avatar {
float: left;
img {
@@ -402,6 +407,14 @@ form {
width: $page-width;
}
}
.speaker_info_component {
.full_image {
img {
max-width: $page-width;
}
}
}
}
@media screen and (min-width: 800px) {
@@ -426,6 +439,14 @@ form {
width: $page-width;
}
}
.speaker_info_component {
.full_image {
img {
max-width: $page-width;
}
}
}
}
@media screen and (min-width: 1000px) {
+14 -2
View File
@@ -4,16 +4,18 @@ class Speaker {
slug: string;
description: string;
avatarUrl?: string;
fullUrl?: string;
constructor(name: string, slug: string, description: string, avatarUrl?: string) {
constructor(name: string, slug: string, description: string, avatarUrl?: string, fullUrl?: string) {
this.name = name;
this.slug = slug;
this.description = description;
this.avatarUrl = avatarUrl;
this.fullUrl = fullUrl;
}
static fromJson(json: any) : Speaker {
return new Speaker(json.name, json.slug, json.description, json.avatarUrl);
return new Speaker(json.name, json.slug, json.description, json.avatarUrl, json.fullUrl);
}
getName() : string {
@@ -35,6 +37,14 @@ class Speaker {
getAvatar() : string | undefined {
return this.avatarUrl;
}
hasFull() : boolean {
return this.fullUrl !== undefined;
}
getFull() : string | undefined {
return this.fullUrl;
}
}
const SPEAKERS : Speaker[] = [
@@ -43,12 +53,14 @@ const SPEAKERS : Speaker[] = [
slug: "christopher-lee",
description: "An actor well known for playing Count Dooku and Saruman.",
avatarUrl: "christopher-lee.jpg",
fullUrl: "christopher-lee-full.png",
}),
Speaker.fromJson({
name: "Danny Devito",
slug: "danny-devito",
description: "Always delightful.",
avatarUrl: "danny-devito.jpg",
fullUrl: "danny-devito-full.png",
}),
Speaker.fromJson({
name: "Gilbert Gottfried",
@@ -17,6 +17,16 @@ class SpeakerInfo extends React.Component<Props, State> {
}
public render() {
if (this.props.currentSpeaker.hasFull()) {
let source = `/full/${this.props.currentSpeaker.fullUrl!}`;
return (
<div className="speaker_info_component">
<div className="full_image">
<img src={source}></img>
</div>
</div>
)
}
return (
<div className="speaker_info_component">
<div className="speaker_avatar">