Skip to content

Commit

Permalink
chore: renamed utils
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd committed Oct 14, 2023
1 parent 4c98b35 commit db86f0e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/Common/AvatarGroup/__tests__/index.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, fireEvent } from '@testing-library/react';

import { githubProfileAvatarUrl } from '@/util/github';
import { githubProfileAvatarUrl } from '@/util/gitHubUtils';

import AvatarGroup from '../index';

Expand Down
2 changes: 1 addition & 1 deletion components/Common/AvatarGroup/index.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta as MetaObj, StoryObj } from '@storybook/react';

import { githubProfileAvatarUrl } from '@/util/github';
import { githubProfileAvatarUrl } from '@/util/gitHubUtils';

import AvatarGroup from './';

Expand Down
2 changes: 1 addition & 1 deletion components/Common/AvatarGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import classNames from 'classnames';
import type { ComponentProps, FC } from 'react';
import { useState, useMemo } from 'react';

import { getAcronymFromString } from '@/util/stringutils';
import { getAcronymFromString } from '@/util/stringUtils';

import Avatar from './Avatar';
import avatarstyles from './Avatar/index.module.css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { githubProfileAvatarUrl } from '@/util/github';
import { githubProfileAvatarUrl } from '@/util/gitHubUtils';

describe('Github utils', () => {
it('githubProfileAvatarUrl returns the correct URL', () => {
Expand Down
2 changes: 2 additions & 0 deletions util/gitHubUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const githubProfileAvatarUrl = (username: string): string =>
`https://avatars.githubusercontent.com/${username}`;
2 changes: 2 additions & 0 deletions util/stringUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const getAcronymFromString = (str: string) =>
[...(str.trim().match(/\b(\w)/g) || '')].join('').toUpperCase();

0 comments on commit db86f0e

Please sign in to comment.