Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Add URL field to header #232

Open
kien-pham opened this issue Aug 24, 2022 · 4 comments
Open

Request: Add URL field to header #232

kien-pham opened this issue Aug 24, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@kien-pham
Copy link

Hello,

I'm using RIS, it's very nice. I have a request, I would like to add link to header, user can click to avatar and it will redirect to other page.
Screen Shot 2022-08-24 at 11 32 45 AM

I hope it will be added on next version.

@mohitk05
Copy link
Owner

mohitk05 commented Apr 5, 2023

Hey @kien-pham, that is a good idea. A possible solution could be to allow passing a custom header. Will scope it for future releases.

@mohitk05 mohitk05 added the enhancement New feature or request label Apr 5, 2023
@ExplorerAadi
Copy link

Hey @mohitk05 , Can I take up this feature?
I believe a custom header component shouldn't be necessary because when we pass content then we define our own headers anyway right? That's how I added a header link in our project.

But if someone is using the header prop of the library then a good solution would be to just add another field like externalLink. Here is an example from a draft request where I implemented this. Please let me know what you think about it and what are the improvements you suggest?

image

@hassnain9166
Copy link

Hi, @kien-pham can help me to add a header I did not able to use it import Modal from "react-bootstrap/Modal";
import React from "react";
import Stories, {
WithSeeMore,
WithVideo,
WithHeader,
} from "react-insta-stories";

export const renderer = ({ story, action, isPaused, config }) => {
if (story.file_type === "video") {
return (


<video
src={story.file}
autoPlay={action === "play"}
muted={!isPaused}
/>

);
} else if (story.file_type === "image") {
return (

Story

);
} else {
return null;
}
};

export const tester = (story) => {
return {
condition: story.file_type === "video" || story.file_type === "image",
priority: 3,
};
};

const App = ({ file, show, handleClose, profile_image }) => {
const convertedStories = file?.map((story) => {
if (story.file_type === "image") {
return { url: story.file, type: "image" };
} else if (story.file_type === "video") {
return { url: story.file, type: "video" };
}
});
return (

<div
style={{
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
// width:"10vw"
}}
>
<Stories
stories={convertedStories}
renderers={[{ renderer, tester }]}
seeMore={}
height={"90vh"}
// width={"100vw"}
/>


);
};

export default App;

@mohitk05
Copy link
Owner

@ExplorerAadi sure, you can submit a PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants