Skip to content

Commit

Permalink
Marking fields private.
Browse files Browse the repository at this point in the history
This helps the IDE (intellij) mark if the fields are used, it seems to
have trouble and always mark fields as used even when they are not.
  • Loading branch information
jasonraimondi committed Feb 13, 2019
1 parent bfd8c65 commit 10aa66d
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/renderer/app/Settings/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Settings extends React.Component<Props, State> {
};
}

get accessToken() {
private get accessToken() {
if (this.props.settings.github) {
return this.props.settings.github.accessToken;
}
Expand Down
8 changes: 4 additions & 4 deletions src/renderer/app/TrendingRepos/TrendingRepos.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ class App extends React.Component<Props, State> {
return language;
}

get frequency() {
private get frequency() {
return this.props.trending.options.frequency;
}

get language() {
private get language() {
return this.props.trending.options.language;
}

get selectedTrend(): TrackUpdateSource<RepositoryEntity[]> | false {
private get selectedTrend(): TrackUpdateSource<RepositoryEntity[]> | false {
const {repositoryList} = this.props.trending;
if (repositoryList
&& repositoryList[this.language.value]
Expand All @@ -140,7 +140,7 @@ class App extends React.Component<Props, State> {
return false;
}

get trendingRepositoryList(): RepositoryEntity[] {
private get trendingRepositoryList(): RepositoryEntity[] {
return this.selectedTrend ? this.selectedTrend.data : [];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface Props {
}

export class EmptyTrendingRepositoryList extends React.Component<Props> {
get githubLink(): string {
private get githubLink(): string {
return `https://github.com/trending/${this.props.language.value}?since=${this.props.frequency}`;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class FrequencyPicker extends React.Component<Props, State> {
this.setState({ frequency }, () => this.props.handleSetFrequency(frequency));
}

get list() {
private get list() {
return ['daily', 'weekly', 'monthly', 'yearly'].map((frequency: FrequencyType) => {
const frequencyTitleCase = frequency.replace(/^\w/, (c) => c.toUpperCase());
const selectedClass = this.props.frequency === frequency ? 'selected' : null;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/app/TrendingRepos/components/LanguageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface Props {
}

export class LanguageList extends React.Component<Props> {
get languageList() {
private get languageList() {
let languageList = this.props.popularLanguageList;

if (this.props.languageListType === 'all') {
Expand Down
20 changes: 10 additions & 10 deletions src/renderer/app/TrendingRepos/components/RepositoryDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@ interface Props {
}

export class RepositoryDetail extends React.Component<Props> {
get attributes() {
private get attributes() {
return this.repository.attributes;
}

get repository() {
private get repository() {
return this.props.repository;
}

get stargazerLink() {
private get stargazerLink() {
const login = this.attributes && this.attributes.owner && this.attributes.owner.login
? this.attributes.owner.login : 'Unknown';
return <Name className='stargazerLink'>{login.replace('/', ' / ')}</Name>;
}

get name() {
private get name() {
const name = this.attributes && this.attributes.name ? this.attributes.name : 'Unknown';
return <Name className='name'>{name}</Name>;
}

get language() {
private get language() {
const language = this.attributes && this.attributes.language ? this.attributes.language : 'Unknown';
return <Language className='language'>{language}</Language>;
}

get description() {
private get description() {
const description = this.attributes ? this.attributes.description : false;
if (description) {
return <Description className='description'>{description}</Description>;
}
return null;
}

get forksCount() {
private get forksCount() {
const forksCount = this.attributes && this.attributes.forksCount ? this.attributes.forksCount : 0;
const title = `${forksCount} Forks`;
return <ForksCount title={title} className='forks-count'>
Expand All @@ -53,7 +53,7 @@ export class RepositoryDetail extends React.Component<Props> {
</ForksCount>;
}

get watchersCount() {
private get watchersCount() {
const watchersCount = this.attributes && this.attributes.watchersCount ? this.attributes.watchersCount : 0;
const title = `${watchersCount} Watchers`;
return <WatchersCount title={title} className='watchers-count'>
Expand All @@ -62,7 +62,7 @@ export class RepositoryDetail extends React.Component<Props> {
</WatchersCount>;
}

get stargazersCount() {
private get stargazersCount() {
const stargazersCount = this.attributes && this.attributes.stargazersCount ? this.attributes.stargazersCount : 0;
const title = `${stargazersCount} Stargazers`;
return <StargazersCount title={title} className='stargazers-count'>
Expand All @@ -71,7 +71,7 @@ export class RepositoryDetail extends React.Component<Props> {
</StargazersCount>;
}

get htmlUrl() {
private get htmlUrl() {
return this.attributes && this.attributes.htmlUrl ? this.attributes.htmlUrl : null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class RepositoryList extends React.Component<Props> {
static readonly STARGAZERS_ICON = require('@/assets/icons/icon-star.svg');
static readonly WATCHERS_ICON = require('@/assets/icons/icon-user-circle.svg');

get listItems() {
private get listItems() {
if (this.props.repositoryList.length === 0 && this.props.emptyRepositoryList) {
return this.props.emptyRepositoryList;
}
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/elements/GithubAccessTokenForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class GithubAccessTokenForm extends React.Component<Props> {
setTimeout(() => setSubmitting(false), 500);
}

get githubLink() {
private get githubLink() {
const dateString = dayjs().format('YYYY-MM-DD');
const description = encodeURIComponent(`Traverse ${dateString}`);
const scopes = [
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/elements/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Props {
}

export class UserProfile extends React.Component<Props> {
get user() {
private get user() {
return this.props.user;
}

Expand Down
6 changes: 3 additions & 3 deletions src/renderer/elements/UserStarredRepositoryList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ interface Props {
}

export class UserStarredRepositoryList extends React.Component<Props> {
get user() {
private get user() {
return this.props.user;
}

get login() {
private get login() {
return this.user && this.user.attributes.login ? this.user.attributes.login : false;
}

Expand All @@ -34,7 +34,7 @@ export class UserStarredRepositoryList extends React.Component<Props> {
}
}

get repositoryList() {
private get repositoryList() {
return this.props.repositoryList;
}

Expand Down

0 comments on commit 10aa66d

Please sign in to comment.