mirror of
https://github.com/rjNemo/devbook_ts
synced 2026-06-11 13:06:43 +00:00
conditional display of social links
This commit is contained in:
parent
3540881ec2
commit
e0f20d253d
1 changed files with 63 additions and 52 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import React, {FC} from 'react';
|
import React, {FC, useState} from 'react';
|
||||||
import {Link} from 'react-router-dom';
|
import {Link} from 'react-router-dom';
|
||||||
import Routes from '../constants/routes';
|
import Routes from '../constants/routes';
|
||||||
// Style
|
// Style
|
||||||
|
|
@ -33,6 +33,7 @@ interface InitFormData {
|
||||||
* Form to update dev's personal information.
|
* Form to update dev's personal information.
|
||||||
*/
|
*/
|
||||||
const EditProfile: FC = () => {
|
const EditProfile: FC = () => {
|
||||||
|
const [showLinks, setShowLinks] = useState(false);
|
||||||
const initFormData = {
|
const initFormData = {
|
||||||
status: '',
|
status: '',
|
||||||
company: '',
|
company: '',
|
||||||
|
|
@ -70,6 +71,8 @@ const EditProfile: FC = () => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
console.log('Submitted');
|
console.log('Submitted');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const revealSocialLinks = () => setShowLinks(true);
|
||||||
return (
|
return (
|
||||||
<section className="container">
|
<section className="container">
|
||||||
<FormHeader
|
<FormHeader
|
||||||
|
|
@ -164,12 +167,18 @@ const EditProfile: FC = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="my-2">
|
<div className="my-2">
|
||||||
<button type="button" className="btn btn-light">
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-light"
|
||||||
|
onClick={revealSocialLinks}
|
||||||
|
>
|
||||||
Add Social Network Links
|
Add Social Network Links
|
||||||
</button>
|
</button>
|
||||||
<span>Optional</span>
|
<span>Optional</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{showLinks && (
|
||||||
|
<>
|
||||||
<div className="form-group social-input">
|
<div className="form-group social-input">
|
||||||
<FontAwesomeIcon icon={faFacebook} size="2x" />
|
<FontAwesomeIcon icon={faFacebook} size="2x" />
|
||||||
<input
|
<input
|
||||||
|
|
@ -224,6 +233,8 @@ const EditProfile: FC = () => {
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
<input type="submit" className="btn btn-primary my-1" value="Submit" />
|
<input type="submit" className="btn btn-primary my-1" value="Submit" />
|
||||||
<Link to={Routes.DASHBOARD} className="btn btn-light my-1">
|
<Link to={Routes.DASHBOARD} className="btn btn-light my-1">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue