<commit_before>import React from 'react';
import PortfolioPage from './PortfolioPage';
import Signup from '../../Auth/Signup.jsx';
import Login from '../../Auth/Login.jsx';
import axios from 'axios';
import {Link} from 'react-router-dom'

export default class PortfolioLanding extends React.Component {
  constructor() {
    super()
    this.state = {
      portfolios: [],
      portfolio_id: 0,
      token: localStorage.getItem('token')
    }
    this.handleFetchData = this.handleFetchData.bind(this);
  }
  componentDidMount() {
    this.handleFetchData();
  }

  handleFetchData(){
    let token = localStorage.getItem('token');
    axios.get('/api/getUserData', {headers: {authorization:token}})
    .then(reply => this.setState({portfolios: reply.data}))
    .catch(err => console.log(err, 'error'))
  }
  
  render() {
    return (
      <div>
        <Signup fetch={this.handleFetchData}/>
        <Login fetch={this.handleFetchData}/>
         <div className='portfolioLanding'>
          {this.state.portfolios.map((item, index) => (
            <Link key={index} to={`/simulator/${index}`}><button className='portfolioLandingButton'>{item.name}</button></Link>
          ))}
        </div> 
      </div>
    )
  }
}<commit_msg>i didnt really do anything<commit_after>import React from 'react';
import PortfolioPage from './PortfolioPage';
import Signup from '../../Auth/Signup.jsx';
import Login from '../../Auth/Login.jsx';
import axios from 'axios';
import {Link} from 'react-router-dom'
import Auth from '../../Auth/Auth.jsx';

export default class PortfolioLanding extends React.Component {
  constructor() {
    super()
    this.Auth = new Auth;
    this.state = {
      portfolios: [],
      portfolio_id: 0,
      token: localStorage.getItem('token')
    }
    this.handleFetchData = this.handleFetchData.bind(this)
  }
  componentDidMount() {
    this.handleFetchData()
  }

  handleFetchData(){
    let token = localStorage.getItem('token')
    axios.get('/api/getUserData', {headers: {authorization:token}})
    .then(reply => this.setState({portfolios: reply.data}))
    .catch(err => console.log(err, 'error'))
  }
  
  render() {
    return (
      <div>
        <Signup fetch={this.handleFetchData}/>
        <Login fetch={this.handleFetchData}/>
         <div className='portfolioLanding'>
          {this.state.portfolios.map((item, index) => (
            <Link key={index} to={`/simulator/${index}`}><button className='portfolioLandingButton'>{item.name}</button></Link>
          ))}
        </div> 
      </div>
    )
  }
}
{'fraction_non_alphanumeric': 0.16549295774647887, 'fraction_numerical': 0.000782472613458529, 'mean_word_length': 3.033123028391167, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6073225', 'n_tokens_mistral': 795, 'n_tokens_neox': 803, 'n_words': 155}