Skip to content
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.

Commit

Permalink
🔥 - removed SocialButton|ProfileList
Browse files Browse the repository at this point in the history
firebase-web-ui react component takes care of what SocialButton|ProfileList use to do. chingu-voyages#94
  • Loading branch information
paulywill committed Apr 29, 2019
1 parent 03f685f commit 5082509
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 166 deletions.
28 changes: 0 additions & 28 deletions client/src/components/CalHM.js

This file was deleted.

1 change: 0 additions & 1 deletion client/src/components/Dashboard.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import SocialProfileList from './SocialProfileList';
import axios from 'axios';
import NewHabit from './NewHabit';
import CheckIn from './check-in';
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Progress.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
import CalHM from '../components/CalHM';
import CalHM from './widgets/CalHM';


class Progress extends Component {
Expand Down
75 changes: 0 additions & 75 deletions client/src/components/SocialButtonList.js

This file was deleted.

60 changes: 0 additions & 60 deletions client/src/components/SocialProfileList.js

This file was deleted.

70 changes: 69 additions & 1 deletion client/src/components/UserSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,72 @@ class UserSettings extends Component {
}
}

export default UserSettings;
export default UserSettings;


/* TESTING: Require the unlink button in user settings
import React, { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
class SocialProfileList extends PureComponent {
static propTypes = {
auth: PropTypes.func.isRequired,
providerData: PropTypes.arrayOf(PropTypes.object).isRequired,
unlinkedProvider: PropTypes.func.isRequired
};
/* Unlinks a provider from the current user account */

/*
handleProviderUnlink = async (e, provider) => {
const { auth, unlinkedProvider } = this.props;
if (window.confirm(`Do you really want to unlink ${provider}?`)) {
const providers = await auth()
.currentUser.unlink(`${provider}.com`)
.catch(err => console.error(err));
unlinkedProvider(provider, providers.providerData);
}
};
renderProfileList = ({ providerId, photoURL }) => {
const providerName = providerId.split('.')[0];
return (
<div className="container__profile" key={providerName}>
<img
src={photoURL}
alt={providerName}
className="container__profile--photo"
/>
<button
className="container__profile--btn"
onClick={e => this.handleProviderUnlink(e, providerName)}
>Unlink
</button>
</div>
);
};
render() {
return (
<Fragment>
<div className="btn__profiles--list">
{this.props.providerData.map(this.renderProfileList)}
</div>
</Fragment>
);
}
}
export default SocialProfileList;
*/

0 comments on commit 5082509

Please sign in to comment.