{"id":4251,"url":"https://github.com/christopherabouabdo/react-native-photo-grid","last_synced_at":"2025-08-04T00:32:45.938Z","repository":{"id":57339051,"uuid":"50962256","full_name":"christopherabouabdo/react-native-photo-grid","owner":"christopherabouabdo","description":null,"archived":false,"fork":false,"pushed_at":"2017-05-17T17:58:36.000Z","size":5,"stargazers_count":36,"open_issues_count":6,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-16T17:53:30.458Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/christopherabouabdo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-03T00:30:24.000Z","updated_at":"2023-03-09T02:23:05.000Z","dependencies_parsed_at":"2022-08-28T07:02:06.476Z","dependency_job_id":null,"html_url":"https://github.com/christopherabouabdo/react-native-photo-grid","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherabouabdo%2Freact-native-photo-grid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherabouabdo%2Freact-native-photo-grid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherabouabdo%2Freact-native-photo-grid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/christopherabouabdo%2Freact-native-photo-grid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/christopherabouabdo","download_url":"https://codeload.github.com/christopherabouabdo/react-native-photo-grid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228576898,"owners_count":17939645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:05.841Z","updated_at":"2024-12-07T07:31:35.253Z","avatar_url":"https://github.com/christopherabouabdo.png","language":"JavaScript","funding_links":[],"categories":["Components"],"sub_categories":["UI"],"readme":"# react-native-photo-grid\nReact Native component that handles the complexities of building a grid of photos with a flexible number of photos per row\n\n## Install\n\n`npm install react-native-photo-grid --save`\n\n## Usage\n\n```\nimport React from 'react-native';\nimport PhotoGrid from 'react-native-photo-grid';\nlet { Image, TouchableOpacity, Text } = React;\n\nclass BestGrid extends React.Component {\n\n  constructor() {\n    super();\n    this.state = { items: [] };\n  }\n\n  componentDidMount() {\n    // Build an array of 60 photos\n    let items = Array.apply(null, Array(60)).map((v, i) =\u003e {\n      return { id: i, src: 'http://placehold.it/200x200?text='+(i+1) }\n    });\n    this.setState({ items });\n  }\n\n  render() {\n    return(\n      \u003cPhotoGrid\n        data = { this.state.items }\n        itemsPerRow = { 3 }\n        itemMargin = { 1 }\n        renderHeader = { this.renderHeader }\n        renderItem = { this.renderItem }\n      /\u003e\n    );\n  }\n\n  renderHeader() {\n    return(\n      \u003cText\u003eI'm on top!\u003c/Text\u003e\n    );\n  }\n\n  renderItem(item, itemSize) {\n    return(\n      \u003cTouchableOpacity\n        key = { item.id }\n        style = {{ width: itemSize, height: itemSize }}\n        onPress = { () =\u003e {\n          // Do Something\n        }}\u003e\n        \u003cImage\n          resizeMode = \"cover\"\n          style = {{ flex: 1 }}\n          source = {{ uri: item.src }}\n        /\u003e\n      \u003c/TouchableOpacity\u003e\n    )\n  }\n\n}\n\nexport default BestGrid;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristopherabouabdo%2Freact-native-photo-grid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchristopherabouabdo%2Freact-native-photo-grid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchristopherabouabdo%2Freact-native-photo-grid/lists"}