Skip to content

Commit

Permalink
Merge pull request #389 from Giphy/feat/upgrade-grid
Browse files Browse the repository at this point in the history
upgrade from class to hook component
  • Loading branch information
matheusmorett2 authored Jun 26, 2023
2 parents 41ef28f + 1d19276 commit 3646c01
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 159 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-students-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@giphy/react-components': major
---

Upgrading Grid from React Classes to React Hooks
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { composeStories } from '@storybook/testing-react'
import * as React from 'react'

import { EmojiVariationsList, Grid } from '../../src'
import { EmojiVariationsList } from '../../src'
import * as stories from '../../stories/emoji-variations-list.stories'
import {
GifTestUtilsContext,
Expand All @@ -12,14 +12,15 @@ import {
resetGifEventsHistory,
setupGifTestUtils,
} from '../utils/gif-test-utils'
import { DEFAULT_GRID_CLASS_NAME } from '../../src/components/grid'

const GIFS_COUNT = 6
const EMOJI_ID = 'dalJ0CpF7hwmN1nZXe'

const { Default: DefaultStory } = composeStories(stories)

function getGridRoot() {
return cy.get(`.${Grid.className}`)
return cy.get(`.${DEFAULT_GRID_CLASS_NAME}`)
}

function getGridGif(id: string) {
Expand Down
5 changes: 2 additions & 3 deletions packages/react-components/cypress/stories/grid.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { composeStories, composeStory } from '@storybook/testing-react'
import * as React from 'react'

import { Grid } from '../../src'
import * as stories from '../../stories/grid.stories'
import {
GifTestUtilsContext,
Expand All @@ -13,6 +11,7 @@ import {
setupGifTestUtils,
} from '../utils/gif-test-utils'
import { storiesCompositionToList } from '../utils/storybook'
import { DEFAULT_GRID_CLASS_NAME } from '../../src/components/grid'

const GIFS_COUNT = 5

Expand All @@ -22,7 +21,7 @@ const composedStories = storiesCompositionToList(composeStories(stories)).filter
)

function getGridRoot() {
return cy.get(`.${Grid.className}`)
return cy.get(`.${DEFAULT_GRID_CLASS_NAME}`)
}

function getGridGifs() {
Expand Down
Loading

0 comments on commit 3646c01

Please sign in to comment.