- {this.props.savePhotoState === 'pending' ? (
-
-
-
- ) : null}
-
-
- Change
-
-
-
+
+
+
+
+
+
+ );
+ }
+ render() {
+ return (
+
+
+
+ {this.props.savePhotoState === 'pending' ? this.renderPending() : this.renderMenu() }
+
+
- {src ? (
-
- Remove
-
- ) : null}
+
);
}
@@ -97,9 +150,11 @@ ProfileAvatar.propTypes = {
onSave: PropTypes.func.isRequired,
onDelete: PropTypes.func.isRequired,
savePhotoState: PropTypes.oneOf([null, 'pending', 'complete', 'error']),
+ isEditable: PropTypes.bool,
};
ProfileAvatar.defaultProps = {
src: null,
savePhotoState: null,
+ isEditable: false,
};
diff --git a/src/index.scss b/src/index.scss
index 71e85b9..1478596 100755
--- a/src/index.scss
+++ b/src/index.scss
@@ -57,6 +57,27 @@ $fa-font-path: "~font-awesome/fonts";
}
}
+ .profile-avatar-menu-container {
+ background: rgba(0,0,0,.65);
+ position: absolute;
+ width: 100%;
+ height: 100%;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ border-radius: 50%;
+ @include media-breakpoint-up(md) {
+ background: linear-gradient(to top, rgba(0,0,0,.65) 4rem, rgba(0,0,0,0) 4rem);
+ align-items: flex-end;
+ }
+ .btn {
+ text-decoration: none;
+ @include media-breakpoint-up(md) {
+ margin-bottom: 1.2rem;
+ }
+ }
+ }
+
.profile-avatar {
width: 5rem;
height: 5rem;