mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 19:14:16 +00:00
cover expands on click
This commit is contained in:
parent
8f104fd319
commit
9afbd45ff6
@ -182,6 +182,12 @@ export default class Account extends React.Component {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toogleCoverExpanded = async (to) => {
|
||||||
|
this.setState({
|
||||||
|
coverExpanded: to ?? !this.state.coverExpanded,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
handlePageTransition = (key) => {
|
handlePageTransition = (key) => {
|
||||||
if (typeof key !== "string") {
|
if (typeof key !== "string") {
|
||||||
console.error("Cannot handle page transition. Invalid key, only valid passing string", key)
|
console.error("Cannot handle page transition. Invalid key, only valid passing string", key)
|
||||||
@ -227,7 +233,14 @@ export default class Account extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return <div className="accountProfile">
|
return <div className="accountProfile">
|
||||||
{user.cover && <div ref={this.coverComponent} className="cover" style={{ backgroundImage: `url("${user.cover}")` }} />}
|
{user.cover && <div
|
||||||
|
className={classnames("cover", {
|
||||||
|
["expanded"]: this.state.coverExpanded
|
||||||
|
})}
|
||||||
|
ref={this.coverComponent}
|
||||||
|
style={{ backgroundImage: `url("${user.cover}")` }}
|
||||||
|
onClick={() => this.toogleCoverExpanded()}
|
||||||
|
/>}
|
||||||
<div className="profileCardWrapper">
|
<div className="profileCardWrapper">
|
||||||
<div className="profileCard">
|
<div className="profileCard">
|
||||||
<div className="basicData">
|
<div className="basicData">
|
||||||
|
@ -30,6 +30,16 @@
|
|||||||
|
|
||||||
transform: translate(0, 10px);
|
transform: translate(0, 10px);
|
||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
|
|
||||||
|
&.expanded {
|
||||||
|
height: 70vh;
|
||||||
|
transform: translate(0, 0);
|
||||||
|
|
||||||
|
background-size: cover;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
border-radius: @borderRadius;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.profileCardWrapper {
|
.profileCardWrapper {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user