aminyasser / twitter-clone

PHP twitter clone with almost all twitter functionalities
78 stars 34 forks source link

How to add comment input box without a modal #11

Closed ryanjacl closed 2 years ago

ryanjacl commented 2 years ago

Can you reply how to add just "write a comment" input box below the post not a comment button

australopythecu commented 2 years ago

Sample code

<div class="retweet-popup-body-wrap">
        <div class="retweet-popup-heading">
            <span><i class="close-retweet-popup fa fa-4x fa-times" aria-hidden="true"></i></span>
            <h2>Comment this Tweet</h2>
            <small>Your behavior and comments count. We don´t allow bullying, harassment, nor sexual content/conduct.</small>
        </div>
        <div class="retweet-popup-input">
            <div class="retweet-popup-input-inner">
                <!--input  class="retweet-msg" type="text" placeholder="Report Ad"/-->
            <center>
                 <input  class="retweet-msg" type="text" placeholder="Add your Comment"/>
                    <button class="btn btn-primary comment-it" 
                data-tweet="<?php echo $tweet_id;?>"
                data-user="<?php echo $user_id;?>"
                data-tmp="<?php echo $retweet_comment; ?>" 
                data-qoq="<?php echo $qoq; ?>" 
             type="submit"><i class="fas fa-pencil-alt" aria-hidden="true"></i> Add Comment</button>
            </center>
            </div>
        </div>

The comment form validate via ajax through the class "comment-it", so you need the js files always.